internal static void PreviewParticles(IPropertyCollector driver, IEnumerable <ParticleSystem> particles)
 {
     foreach (var ps in particles)
     {
         driver.AddFromName <ParticleSystem>(ps.gameObject, "randomSeed");
         driver.AddFromName <ParticleSystem>(ps.gameObject, "autoRandomSeed");
     }
 }
示例#2
0
 public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
 {
     if (!(director == null))
     {
         if (!ControlPlayableAsset.s_ProcessedDirectors.Contains(director))
         {
             ControlPlayableAsset.s_ProcessedDirectors.Add(director);
             GameObject gameObject = this.sourceGameObject.Resolve(director);
             if (gameObject != null)
             {
                 if (this.updateParticle)
                 {
                     foreach (ParticleSystem particleSystem in this.GetComponent <ParticleSystem>(gameObject))
                     {
                         driver.AddFromName <ParticleSystem>(particleSystem.gameObject, "randomSeed");
                         driver.AddFromName <ParticleSystem>(particleSystem.gameObject, "autoRandomSeed");
                     }
                 }
                 if (this.active)
                 {
                     driver.AddFromName(gameObject, "m_IsActive");
                 }
                 if (this.updateITimeControl)
                 {
                     foreach (MonoBehaviour monoBehaviour in ControlPlayableAsset.GetControlableScripts(gameObject))
                     {
                         IPropertyPreview propertyPreview = monoBehaviour as IPropertyPreview;
                         if (propertyPreview != null)
                         {
                             propertyPreview.GatherProperties(director, driver);
                         }
                         else
                         {
                             driver.AddFromComponent(monoBehaviour.gameObject, monoBehaviour);
                         }
                     }
                 }
                 if (this.updateDirector)
                 {
                     foreach (PlayableDirector playableDirector in this.GetComponent <PlayableDirector>(gameObject))
                     {
                         if (!(playableDirector == null))
                         {
                             TimelineAsset timelineAsset = playableDirector.playableAsset as TimelineAsset;
                             if (!(timelineAsset == null))
                             {
                                 timelineAsset.GatherProperties(playableDirector, driver);
                             }
                         }
                     }
                 }
             }
             ControlPlayableAsset.s_ProcessedDirectors.Remove(director);
         }
     }
 }
示例#3
0
 public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
 {
     if (director != null)
     {
         var binding = director.GetGenericBinding(this);
         if (binding is CanvasGroup cg)
         {
             driver.AddFromName <CanvasGroup>(cg.gameObject, "m_Interactable");
             driver.AddFromName <CanvasGroup>(cg.gameObject, "m_BlocksRaycasts");
         }
     }
 }
示例#4
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
#if UNITY_EDITOR
            CinemachineDollyCart trackBinding = director.GetGenericBinding(this) as CinemachineDollyCart;
            if (trackBinding == null)
                return;

            driver.AddFromName<CinemachineDollyCart>(trackBinding.gameObject, "m_Position");
            driver.AddFromName<CinemachineDollyCart>(trackBinding.gameObject, "m_Speed");
#endif
            base.GatherProperties(director, driver);
        }
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
#if UNITY_EDITOR
            var controller = director.GetGenericBinding(this) as EZGraphicColorAnimation;
            if (controller == null || controller.targetGraphic == null)
            {
                return;
            }
            driver.AddFromName <EZGraphicColorAnimation>(controller.gameObject, "m_Time");
            driver.AddFromName <Graphic>(controller.targetGraphic.gameObject, "m_Color");
#endif
            base.GatherProperties(director, driver);
        }
示例#6
0
    /// <summary>IPropertyPreview implementation</summary>
    /// <param name="director"></param>
    /// <param name="driver"></param>
    public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    {
        driver.AddFromName <Transform>("m_LocalPosition.x");
        driver.AddFromName <Transform>("m_LocalPosition.y");
        driver.AddFromName <Transform>("m_LocalPosition.z");
        driver.AddFromName <Transform>("m_LocalRotation.x");
        driver.AddFromName <Transform>("m_LocalRotation.y");
        driver.AddFromName <Transform>("m_LocalRotation.z");
        driver.AddFromName <Transform>("m_LocalRotation.w");

        driver.AddFromName <Camera>("field of view");
        driver.AddFromName <Camera>("near clip plane");
        driver.AddFromName <Camera>("far clip plane");
    }
示例#7
0
 // Token: 0x060001AF RID: 431 RVA: 0x00008D84 File Offset: 0x00006F84
 public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
 {
     if (director != null)
     {
         GameObject gameObject = this.sourceGameObject.Resolve(director);
         if (gameObject != null)
         {
             if (this.updateParticle)
             {
                 foreach (ParticleSystem particleSystem in this.GetParticleSystemRoots(gameObject))
                 {
                     driver.AddFromName <ParticleSystem>(particleSystem.gameObject, "randomSeed");
                     driver.AddFromName <ParticleSystem>(particleSystem.gameObject, "autoRandomSeed");
                 }
             }
             if (this.active)
             {
                 driver.AddFromName(gameObject, "m_IsActive");
             }
             //if (this.updateITimeControl)
             //{
             //    foreach (MonoBehaviour monoBehaviour in TestControlPlayableAsset.GetControlableScripts(gameObject))
             //    {
             //        IPropertyPreview propertyPreview = monoBehaviour as IPropertyPreview;
             //        if (propertyPreview != null)
             //        {
             //            propertyPreview.GatherProperties(director, driver);
             //        } else
             //        {
             //            driver.AddFromComponent(monoBehaviour.gameObject, monoBehaviour);
             //        }
             //    }
             //}
             //if (this.updateDirector)
             //{
             //    foreach (PlayableDirector playableDirector in this.GetComponent<PlayableDirector>(gameObject))
             //    {
             //        if (!(playableDirector == null))
             //        {
             //            TimelineAsset timelineAsset = playableDirector.playableAsset as TimelineAsset;
             //            if (!(timelineAsset == null))
             //            {
             //                timelineAsset.GatherProperties(playableDirector, driver);
             //            }
             //        }
             //    }
             //}
         }
     }
 }
    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    {
#if UNITY_EDITOR
        Light trackBinding = director.GetGenericBinding(this) as Light;
        if (trackBinding == null)
        {
            return;
        }
        driver.AddFromName <Light>(trackBinding.gameObject, "m_Color");
        driver.AddFromName <Light>(trackBinding.gameObject, "m_Intensity");
        driver.AddFromName <Light>(trackBinding.gameObject, "m_Range");
        driver.AddFromName <Light>(trackBinding.gameObject, "m_BounceIntensity");
#endif
        base.GatherProperties(director, driver);
    }
示例#9
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            if (template.controls == null)
            {
                return;
            }

            foreach (var ctrl in template.controls)
            {
                if (!ctrl.enabled)
                {
                    continue;
                }

                var component = ctrl.targetComponent.Resolve(director);
                if (component == null)
                {
                    continue;
                }

                if (string.IsNullOrEmpty(ctrl.fieldName))
                {
                    continue;
                }

                // This extension method is implemented in IPropertyCollectorExtension.cs
                driver.AddFromName(component.GetType(), component.gameObject, ctrl.fieldName);
            }
        }
 internal static void PreviewActivation(IPropertyCollector driver, IEnumerable <GameObject> objects)
 {
     foreach (var gameObject in objects)
     {
         driver.AddFromName(gameObject, "m_IsActive");
     }
 }
        public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            if (!(director == null) && !s_ProcessedDirectors.Contains(director))
            {
                s_ProcessedDirectors.Add(director);
                GameObject val = GetGameObjectBinding(director);
                if (val != null)
                {
                    if (active)
                    {
                        driver.AddFromName(val, "m_IsActive");
                    }

                    if (updateDirector)
                    {
                        foreach (PlayableDirector item in GetComponent <PlayableDirector>(val))
                        {
                            if (!(item == null))
                            {
                                TimelineAsset timelineAsset = item.playableAsset as TimelineAsset;
                                if (!(timelineAsset == null))
                                {
                                    timelineAsset.GatherProperties(item, driver);
                                }
                            }
                        }
                    }
                }
                s_ProcessedDirectors.Remove(director);
            }
        }
示例#12
0
    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    {
#if false
#if UNITY_EDITOR
        Light trackBinding = director.GetGenericBinding(this) as Light;
        if (trackBinding == null)
        {
            return;
        }

        var serializedObject = new UnityEditor.SerializedObject(trackBinding);
        var iterator         = serializedObject.GetIterator();
        while (iterator.NextVisible(true))
        {
            if (iterator.hasVisibleChildren)
            {
                continue;
            }

            driver.AddFromName <Light>(trackBinding.gameObject, iterator.propertyPath);
        }
#endif
#endif
        base.GatherProperties(director, driver);
    }
        // Invoked by the timeline editor to put properties into preview mode. This permits the timeline
        // to temporarily change fields for the purpose of previewing in EditMode.
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            TMP_Text trackBinding = director.GetGenericBinding(this) as TMP_Text;

            if (trackBinding == null)
            {
                return;
            }

            // The field names are the name of the backing serializable field. These can be found from the class source,
            // or from the unity scene file that contains an object of that type.
            driver.AddFromName <TMP_Text>(trackBinding.gameObject, "m_text");
            driver.AddFromName <TMP_Text>(trackBinding.gameObject, "m_fontSize");
            driver.AddFromName <TMP_Text>(trackBinding.gameObject, "m_fontColor");

            base.GatherProperties(director, driver);
        }
示例#14
0
        // IPropertyPreview implementation
#pragma warning disable CS0246 // The type or namespace name 'IPropertyCollector' could not be found (are you missing a using directive or an assembly reference?)
        public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
#pragma warning restore CS0246 // The type or namespace name 'IPropertyCollector' could not be found (are you missing a using directive or an assembly reference?)
        {
            driver.AddFromName <Transform>("m_LocalPosition.x");
            driver.AddFromName <Transform>("m_LocalPosition.y");
            driver.AddFromName <Transform>("m_LocalPosition.z");
            driver.AddFromName <Transform>("m_LocalRotation.x");
            driver.AddFromName <Transform>("m_LocalRotation.y");
            driver.AddFromName <Transform>("m_LocalRotation.z");

            driver.AddFromName <Camera>("field of view");
            driver.AddFromName <Camera>("near clip plane");
            driver.AddFromName <Camera>("far clip plane");
        }
示例#15
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            //
            // In this track, the following properties will be modified.
            //
            // - transform.position
            // - transform.rotation
            // - particleSystem.useAutoRandomSeed
            // - particleSystem.main.duration
            // - particleSystem.emission.rateOverTimeMultiplier
            // - particleSystem.emission.rateOverDistanceMultiplier
            //
            // Note that the serialized property names are a bit defferent from
            // their property name.
            //

            var ps = director.GetGenericBinding(this) as ParticleSystem;

            if (ps == null)
            {
                return;
            }

            var go = ps.gameObject;

            driver.AddFromName <Transform>(go, "m_LocalPosition");
            driver.AddFromName <Transform>(go, "m_LocalRotation");

            driver.AddFromName <ParticleSystem>(go, "lengthInSec");
            driver.AddFromName <ParticleSystem>(go, "autoRandomSeed");
            driver.AddFromName <ParticleSystem>(go, "randomSeed");

            driver.AddFromName <ParticleSystem>(go, "EmissionModule.rateOverTime.scalar");
            driver.AddFromName <ParticleSystem>(go, "EmissionModule.rateOverDistance.scalar");
        }
示例#16
0
        public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            var streamComponent = streamPlayer.Resolve(director);

            if (streamComponent != null)
            {
                driver.AddFromName <AlembicStreamPlayer>(streamComponent.gameObject, "currentTime");
            }
        }
示例#17
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            SkeletonGraphic skeletonGraphic = (SkeletonGraphic)director.GetGenericBinding(this);

            if (skeletonGraphic != null)
            {
                driver.AddFromName <SkeletonGraphic>(skeletonGraphic.gameObject, "freeze");
            }
        }
示例#18
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            SkeletonAnimation skeletonAnimation = (SkeletonAnimation)director.GetGenericBinding(this);

            if (skeletonAnimation != null)
            {
                driver.AddFromName <SkeletonAnimation>(skeletonAnimation.gameObject, "m_Enabled");
            }
        }
示例#19
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            GameObject gameObjectBinding = base.GetGameObjectBinding(director);

            if (gameObjectBinding != null)
            {
                driver.AddFromName(gameObjectBinding, "m_IsActive");
            }
        }
示例#20
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            var binding = director.GetGenericBinding(this) as Transform;

            if (binding == null)
            {
                return;
            }
            driver.AddFromName <Transform>(binding.gameObject, "m_LocalPosition");
            base.GatherProperties(director, driver);
        }
示例#21
0
    // Please note this assumes only one component of type SpriteRenderer on the same gameobject.
    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    {
#if UNITY_EDITOR
        SpriteRenderer trackBinding = director.GetGenericBinding(this) as SpriteRenderer;
        if (trackBinding == null)
        {
            return;
        }

        // These field names are procedurally generated estimations based on the associated property names.
        // If any of the names are incorrect you will get a DrivenPropertyManager error saying it has failed to register the name.
        // In this case you will need to find the correct backing field name.
        // The suggested way of finding the field name is to:
        // 1. Make sure your scene is serialized to text.
        // 2. Search the text for the track binding component type.
        // 3. Look through the field names until you see one that looks correct.
        driver.AddFromName <SpriteRenderer>(trackBinding.gameObject, "m_Color");
        driver.AddFromName <SpriteRenderer>(trackBinding.gameObject, "m_Enabled");
#endif
        base.GatherProperties(director, driver);
    }
示例#22
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
#if UNITY_EDITOR
            AutoBlink trackBinding = director.GetGenericBinding(this) as AutoBlink;
            if (trackBinding == null)
            {
                return;
            }

            driver.AddFromName <AutoBlink>(trackBinding.gameObject, "blinkOverrider");
#endif
        }
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
#if UNITY_EDITOR
            var controller = director.GetGenericBinding(this) as EZTransformAnimation;
            if (controller == null || controller.targetTransform == null)
            {
                return;
            }
            driver.AddFromName <EZTransformAnimation>(controller.gameObject, "m_Time");
            driver.AddFromComponent(controller.targetTransform.gameObject, controller.targetTransform);
#endif
            base.GatherProperties(director, driver);
        }
示例#24
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            var ps = director.GetGenericBinding(this) as Image;

            if (ps == null)
            {
                return;
            }

            var go = ps.gameObject;

            driver.AddFromName <Image>(go, "m_Color");
        }
示例#25
0
    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    {
#if UNITY_EDITOR
        var trackBinding = ((TimelineLabel)director.GetGenericBinding(this)).label.gameObject;
        if (trackBinding == null)
        {
            return;
        }

        driver.AddFromName <Text>(trackBinding.gameObject, "m_Text");
#endif
        base.GatherProperties(director, driver);
    }
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            // Timelineから外したときに値を戻したい場合はこのように書く
#if UNITY_EDITOR
            TimelineHandControl trackBinding = director.GetGenericBinding(this) as TimelineHandControl;
            if (trackBinding == null)
            {
                return;
            }

            driver.AddFromName <TimelineHandControl>(trackBinding.gameObject, "handShape");
#endif
        }
示例#27
0
    public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
    {
        var transform = director.GetGenericBinding(this) as Transform;

        if (transform == null)
        {
            return;
        }

        foreach (var smr in transform.GetComponentsInChildren <SkinnedMeshRenderer>())
        {
            driver.AddFromName <SkinnedMeshRenderer>(smr.gameObject, "m_MotionVectors");
        }
    }
示例#28
0
        public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            GameObject gameObjectBinding = this.GetGameObjectBinding(director);

            if (!((UnityEngine.Object)gameObjectBinding != (UnityEngine.Object)null))
            {
                return;
            }

            foreach (Transform child in gameObjectBinding.transform)
            {
                driver.AddFromName(child.gameObject, "m_IsActive");
            }
        }
示例#29
0
        public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            GameObject gameObject = GetGameObjectBinding(director);

            if (!gameObject)
            {
                return;
            }

            if (this.updateParticle)
            {
                foreach (ParticleSystem particleSystem in this.GetParticleSystems(gameObject))
                {
                    driver.AddFromName <ParticleSystem>(particleSystem.gameObject, "randomSeed");
                    driver.AddFromName <ParticleSystem>(particleSystem.gameObject, "autoRandomSeed");
                }
            }
            if (this.active)
            {
                driver.AddFromName(gameObject, "m_IsActive");
            }
            if (this.updateITimeControl)
            {
                foreach (MonoBehaviour controlableScript in this.GetControlableScripts(gameObject))
                {
                    IPropertyPreview propertyPreview = controlableScript as IPropertyPreview;
                    if (propertyPreview != null)
                    {
                        propertyPreview.GatherProperties(director, driver);
                    }
                    else
                    {
                        driver.AddFromComponent(controlableScript.gameObject, (Component)controlableScript);
                    }
                }
            }
        }
        // Defines which properties are changed by this playable. Those properties will be reverted in editmode
        // when Timeline's preview is turned off.
        public void GatherProperties(PlayableDirector director, IPropertyCollector driver)
        {
            const string kLocalPosition = "m_LocalPosition";
            const string kLocalRotation = "m_LocalRotation";

            driver.AddFromName <Transform>(kLocalPosition + ".x");
            driver.AddFromName <Transform>(kLocalPosition + ".y");
            driver.AddFromName <Transform>(kLocalPosition + ".z");
            driver.AddFromName <Transform>(kLocalRotation + ".x");
            driver.AddFromName <Transform>(kLocalRotation + ".y");
            driver.AddFromName <Transform>(kLocalRotation + ".z");
            driver.AddFromName <Transform>(kLocalRotation + ".w");
        }