コード例 #1
0
        private void ComposeSequence()
        {
            sequence         = SuperInvoke.CreateSequence();
            movementDuration = SliderInScene.value / 2f;                                        // 2 movements of equal duration

            sequence.AddMethod(() => bombMover.MoveTo(new Vector2(0, 2.2f), movementDuration)); // move up
            sequence.AddDelay(movementDuration);

            // after the previous delay, rotate and move to right and down
            sequence.AddMethod(() => bombRotator.RotateZ(20f));
            sequence.AddMethod(() => bombMover.MoveTo(new Vector2(4.5f, -0.5f), movementDuration));
            sequence.AddDelay(movementDuration);

            // at the end, bomb explodes
            sequence.AddMethod(() => bombScaler.Scale(0));
            sequence.AddMethod(() => explosion.Play());
        }
コード例 #2
0
        void Update()
        {
            if (TriggerMovement)
            {
                TriggerMovement = false;

                SuperInvoke.Run(() => sphereMover.MoveTo(myDirection), Delay);                                                 // Main line. Parameterized method execution delayed.
            }
        }
コード例 #3
0
        private void ComposeSequence()
        {
            sequence = SuperInvoke.CreateSequence();

            sequence.AddMethod(ResetTransform);                                     // reset position, scale, and rotation for every repeat

            // divided by two because there are two movements in two different point
            // so that the repeat and the movements are synced, i.e. total movements time = repeat rate
            float oneMovementDuration = RepeatRate / 2f;


            sequence.AddMethod(() => bombMover.MoveTo(new Vector2(0, 2.2f), oneMovementDuration));                                    // move to up

            sequence.AddDelay(oneMovementDuration);
            sequence.AddMethod(() => bombRotator.RotateZ(20f));
            sequence.AddMethod(() => bombMover.MoveTo(new Vector2(4.5f, -0.5f), oneMovementDuration));

            sequence.AddDelay(oneMovementDuration);
            sequence.AddMethod(() => bombScaler.Scale(0));
            sequence.AddMethod(() => explosion.Play());
        }
コード例 #4
0
 private void moveCubeToRight()
 {
     cubeMover.MoveTo(Direction.RIGHT);
 }
コード例 #5
0
 private void moveCubeToRight()
 {
     cubeMover.ReturnToInitialPosition();
     cubeMover.MoveTo(Direction.RIGHT, repeatRate);                                     //Same Repeat Rate to be synced with the movement and the repeat rate.
 }