FObject.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using UnityEngine;
  2. using System.Collections;
  3. namespace Flux
  4. {
  5. /**
  6. * @brief Base of all the classes that create a sequence.
  7. * @sa CTimeline, CTrack, CEvent
  8. */
  9. public abstract class FObject : MonoBehaviour
  10. {
  11. /**
  12. * @brief id usually reference to the index of this element
  13. * relative to it's parent, e.g. index of the timeline in the sequence,
  14. * index of the track in the timeline, or of the event in the track.
  15. */
  16. [SerializeField]
  17. [HideInInspector]
  18. private int _id = -1;
  19. /// @brief _id inspector
  20. public int GetId(){ return _id; }
  21. /**
  22. * @brief Sets _id. It is used when the element is moved in a list to update it's position.
  23. */
  24. internal void SetId( int id ) { _id = id; }
  25. /// @brief Sequence this flux object belongs to
  26. public abstract FSequence Sequence { get; }
  27. /// @brief To whom does this object belong to?
  28. public abstract Transform Owner { get; }
  29. /// @brief Called on the initialization step, use this to setup code that may be more intensive.
  30. /// @note It is only called once, either manually or when a sequence is played.
  31. /// @note It is called left to right, earlier events get called first.
  32. public abstract void Init();
  33. /// @brief Called when you stop the sequence.
  34. /// @note It is called when the sequence is stopped, i.e. resetted.
  35. /// @note It is called right to left, later events get called first.
  36. public abstract void Stop();
  37. }
  38. }