///<summary>Creates a new PTweenInstance with the components value to be animated</summary> public static PTweenInstance PlayTweenComponent(PTweenComponent ptweenComponent, PTweenAnimationDirection animationDirection) { PTweenInstance instance = CreateNewPTWeenInstance(ptweenComponent); instance.AnimationDirection = animationDirection; ResetPTweenInstance(instance); return(instance); }
///<summary>Creates and return a new PTweenInstance with the components value</summary> public static PTweenInstance CreateNewPTWeenInstance(PTweenComponent ptweeComponent) { PTweenInstance instance = new PTweenInstance(); instance.Target = ptweeComponent; instance.Position = new PTweenTransformClip(); instance.Rotation = new PTweenTransformClip(); instance.Scale = new PTweenTransformClip(); instance.Alpha = new PtweenAlphaClip(); instance.Position.From = ptweeComponent.Position.From; instance.Position.To = ptweeComponent.Position.To; instance.Position.Curve = ptweeComponent.Position.Curve; instance.Position.Duration = ptweeComponent.Position.Duration; instance.Position.Animate = ptweeComponent.Position.Animate; instance.Position.Delay = ptweeComponent.Position.Delay; instance.Rotation.From = ptweeComponent.Rotation.From; instance.Rotation.To = ptweeComponent.Rotation.To; instance.Rotation.Curve = ptweeComponent.Rotation.Curve; instance.Rotation.Duration = ptweeComponent.Rotation.Duration; instance.Rotation.Animate = ptweeComponent.Rotation.Animate; instance.Rotation.Delay = ptweeComponent.Rotation.Delay; instance.Scale.From = ptweeComponent.Scale.From; instance.Scale.To = ptweeComponent.Scale.To; instance.Scale.Curve = ptweeComponent.Scale.Curve; instance.Scale.Duration = ptweeComponent.Scale.Duration; instance.Scale.Animate = ptweeComponent.Scale.Animate; instance.Scale.Delay = ptweeComponent.Scale.Delay; instance.Alpha.From = ptweeComponent.Alhpa.From; instance.Alpha.To = ptweeComponent.Alhpa.To; instance.Alpha.Curve = ptweeComponent.Alhpa.Curve; instance.Alpha.Duration = ptweeComponent.Alhpa.Duration; instance.Alpha.Animate = ptweeComponent.Alhpa.Animate; instance.Alpha.Delay = ptweeComponent.Alhpa.Delay; instance.Alpha.CanvasGroup = ptweeComponent.Alhpa.CanvasGroup; instance.Finished = false; return(instance); }