Example #1
0
        void Start()
        {
            ShowTransitionedDescription("Basic linked transitions  with events");

            // Create a new transition to move the gameobject with a delay of 1 and duration of 3 and the specified actions
            var startPosition = new Vector3(10, 0, 0);
            var endPosition   = Vector3.zero;
            var transition    = new Move(TestGameObject, startPosition, endPosition, 1, 3,
                                         tweenType: TransitionHelper.TweenType.easeInOutBack, onStart: LogStart, onUpdate: LogUpdate, onComplete: LogComplete);

            // Add an additional complete action with custom data
            transition.AddOnCompleteAction(LogComplete, "Complete Parameter");

            // chaing some additional transitions and on complete call next transition
            transition.ScaleToOriginal(Vector3.zero, 1, 1, runAtStart: true).
            RotateFromOriginal(new Vector3(360, 0, 0), 1, 3, coordinateMode: TransitionStep.CoordinateSpaceType.Local, runAtStart: true).
            RotateToOriginal(new Vector3(180, 0, 0), duration: 2).
            ScaleFromOriginal(Vector3.zero, delay: 1, duration: 2, runAtStart: true, onComplete: TransitionItem2);

            // start everything.
            transition.Start();
        }