public bool IsAnimatable(PropertyModification[] modifications)
        {
            bool result;

            for (int i = 0; i < modifications.Length; i++)
            {
                IPlayableAsset playableAsset = modifications[i].target as IPlayableAsset;
                if (playableAsset != null)
                {
                    TimelineClip timelineClip = TimelineRecording.FindClipWithAsset(this.state.timeline, playableAsset, this.state.currentDirector);
                    if (timelineClip != null && timelineClip.IsParameterAnimatable(modifications[i].propertyPath))
                    {
                        result = true;
                        return(result);
                    }
                }
            }
            foreach (GameObject current in TimelineRecording.GetRecordableGameObjects(this.state))
            {
                for (int j = 0; j < modifications.Length; j++)
                {
                    PropertyModification propertyModification = modifications[j];
                    if (AnimationWindowUtility.PropertyIsAnimatable(propertyModification.target, propertyModification.propertyPath, current))
                    {
                        result = true;
                        return(result);
                    }
                }
            }
            result = false;
            return(result);
        }
        public bool IsAnimatable(PropertyModification[] modifications)
        {
            // search playable assets
            for (int i = 0; i < modifications.Length; i++)
            {
                var iAsset = modifications[i].target as IPlayableAsset;
                if (iAsset != null)
                {
                    var curvesOwner = AnimatedParameterUtility.ToCurvesOwner(iAsset, state.editSequence.asset);
                    if (curvesOwner != null && curvesOwner.HasAnyAnimatableParameters() && curvesOwner.IsParameterAnimatable(modifications[i].propertyPath))
                    {
                        return(true);
                    }
                }
            }

            // search recordable game objects
            foreach (var gameObject in TimelineRecording.GetRecordableGameObjects(state))
            {
                for (int i = 0; i < modifications.Length; ++i)
                {
                    var modification = modifications[i];
                    if (AnimationWindowUtility.PropertyIsAnimatable(modification.target, modification.propertyPath, gameObject))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        public bool IsAnimatable(PropertyModification[] modifications)
        {
            // search playable assets
            for (int i = 0; i < modifications.Length; i++)
            {
                var iAsset = modifications[i].target as IPlayableAsset;
                if (iAsset != null)
                {
                    TimelineClip clip = TimelineRecording.FindClipWithAsset(state.editSequence.asset, iAsset, state.editSequence.director);
                    if (clip != null && clip.IsParameterAnimatable(modifications[i].propertyPath))
                    {
                        return(true);
                    }
                }
            }

            // search recordable game objects
            foreach (var gameObject in TimelineRecording.GetRecordableGameObjects(state))
            {
                for (int i = 0; i < modifications.Length; ++i)
                {
                    var modification = modifications[i];
                    if (AnimationWindowUtility.PropertyIsAnimatable(modification.target, modification.propertyPath, gameObject))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
        public bool IsAnimatable(PropertyModification[] modifications)
        {
            for (int i = 0; i < modifications.Length; ++i)
            {
                var modification = modifications[i];
                if (AnimationWindowUtility.PropertyIsAnimatable(modification.target, modification.propertyPath, state.activeRootGameObject))
                {
                    return(true);
                }
            }

            return(false);
        }