IPropertyCollector.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. using System.Collections.Generic;
  2. namespace UnityEngine.Timeline
  3. {
  4. /// <summary>
  5. /// Interface used to inform the Timeline Editor about potential property modifications that may occur while previewing.
  6. /// </summary>
  7. public interface IPropertyCollector
  8. {
  9. /// <summary>
  10. /// Sets the active game object for subsequent property modifications.
  11. /// </summary>
  12. /// <param name="gameObject">The GameObject to push.</param>
  13. void PushActiveGameObject(GameObject gameObject);
  14. /// <summary>
  15. /// Removes the active GameObject from the modification stack, restoring the previous value.
  16. /// </summary>
  17. void PopActiveGameObject();
  18. /// <summary>
  19. /// Add properties modified by an animation clip.
  20. /// </summary>
  21. /// <param name="clip">The animation clip that contains the properties</param>
  22. void AddFromClip(AnimationClip clip);
  23. /// <summary>
  24. /// Add property modifications specified by a list of animation clips.
  25. /// </summary>
  26. /// <param name="clips">The list of animation clips used to determine which property modifications to apply.</param>
  27. void AddFromClips(IEnumerable<AnimationClip> clips);
  28. /// <summary>
  29. /// Add property modifications using the serialized property name.
  30. /// </summary>
  31. /// <param name="name">The name of the serialized property</param>
  32. /// <typeparam name="T">The type of the component the property exists on</typeparam>
  33. /// <remarks>
  34. /// This method uses the most recent gameObject from PushActiveGameObject
  35. /// </remarks>
  36. void AddFromName<T>(string name) where T : Component;
  37. /// <summary>
  38. /// Add property modifications using the serialized property name.
  39. /// </summary>
  40. /// <param name="name">The name of the serialized property</param>
  41. /// <remarks>
  42. /// This method uses the most recent gameObject from PushActiveGameObject
  43. /// </remarks>
  44. void AddFromName(string name);
  45. /// <summary>
  46. /// Add property modifications modified by an animation clip.
  47. /// </summary>
  48. /// <param name="obj">The GameObject where the properties exist</param>
  49. /// <param name="clip">The animation clip that contains the properties</param>
  50. void AddFromClip(GameObject obj, AnimationClip clip);
  51. /// <summary>
  52. /// Add property modifications specified by a list of animation clips.
  53. /// </summary>
  54. /// <param name="obj">The gameObject that will be animated</param>
  55. /// <param name="clips">The list of animation clips used to determine which property modifications to apply.</param>
  56. void AddFromClips(GameObject obj, IEnumerable<AnimationClip> clips);
  57. /// <summary>
  58. /// Add property modifications using the serialized property name.
  59. /// </summary>
  60. /// <param name="name">The name of the serialized property</param>
  61. /// <param name="obj">The gameObject where the properties exist</param>
  62. /// <typeparam name="T">The type of the component the property exists on</typeparam>>
  63. void AddFromName<T>(GameObject obj, string name) where T : Component;
  64. /// <summary>
  65. /// Add property modifications using the serialized property name.
  66. /// </summary>
  67. /// <param name="obj">The gameObject where the properties exist</param>
  68. /// <param name="name">The name of the serialized property</param>
  69. void AddFromName(GameObject obj, string name);
  70. /// <summary>
  71. /// Add property modifications using the serialized property name.
  72. /// </summary>
  73. /// <param name="name">The name of the serialized property</param>
  74. /// <param name="component">The component where the properties exist</param>
  75. void AddFromName(Component component, string name);
  76. /// <summary>
  77. /// Set all serializable properties on a component to be under preview control.
  78. /// </summary>
  79. /// <param name="obj">The gameObject where the properties exist</param>
  80. /// <param name="component">The component to set in preview mode</param>
  81. void AddFromComponent(GameObject obj, Component component);
  82. /// <summary>
  83. /// Add property modifications modified by an animation clip.
  84. /// </summary>
  85. /// <param name="obj">The Object where the properties exist</param>
  86. /// <param name="clip">The animation clip that contains the properties</param>
  87. void AddObjectProperties(Object obj, AnimationClip clip);
  88. }
  89. }