示例#1
0
        public override Vector3 Evaluate(TweenRotateBehaviour tween, Vector3 initial, float time, float duration)
        {
            var t      = EasingUtils.Evaluate(tween.Easing, tween.CustomCurve, time, duration);
            var target = tween.TargetRotation;

            if (tween.IsFrom)
            {
                target  = initial;
                initial = tween.TargetRotation;
            }
            return(initial * (1 - t) + target * t);
        }
示例#2
0
        public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
        {
            foreach (var clip in GetClips())
            {
                var myAsset = clip.asset as TweenScaleAsset;
                if (myAsset != null)
                {
                    myAsset.Template.EndTime       = clip.end;
                    myAsset.Template.VISUAL_EASING = new AnimationCurve(EasingUtils.GetKeysForEasing(myAsset.Template.Easing));
                }
            }

            var scriptPlayable = ScriptPlayable <TweenScaleMixerBehaviour> .Create(graph, inputCount);

            return(scriptPlayable);
        }