示例#1
0
        public MTSpawn(params MTFiniteTimeAction[] actions)
        {
            MTFiniteTimeAction prev = actions [0];
            MTFiniteTimeAction next = null;

            if (actions.Length == 1)
            {
                next = new MTExtraAction();
            }
            else
            {
                // We create a nested set of MTSpawnActions out of all of the actions
                for (int i = 1; i < actions.Length - 1; i++)
                {
                    prev = new MTSpawn(prev, actions [i]);
                }

                next = actions [actions.Length - 1];
            }

            // Can't call base(duration) because we need to determine max duration
            // Instead call base's init method here
            if (prev != null && next != null)
            {
                Duration = Math.Max(prev.Duration, next.Duration);
                InitMTSpawn(prev, next);
            }
        }
示例#2
0
        public MTSpawn(params MTFiniteTimeAction[] actions)
        {
            MTFiniteTimeAction prev = actions [0];
            MTFiniteTimeAction next = null;

            if (actions.Length == 1)
            {
                next = new MTExtraAction ();
            }
            else
            {
                // We create a nested set of MTSpawnActions out of all of the actions
                for (int i = 1; i < actions.Length - 1; i++)
                {
                    prev = new MTSpawn (prev, actions [i]);
                }

                next = actions [actions.Length - 1];
            }

            // Can't call base(duration) because we need to determine max duration
            // Instead call base's init method here
            if (prev != null && next != null)
            {
                Duration = Math.Max (prev.Duration, next.Duration);
                InitMTSpawn (prev, next);
            }
        }
示例#3
0
        public MTSpawnState(MTSpawn action, GameObject target)
            : base(action, target)
        {
            ActionOne = action.ActionOne;
            ActionTwo = action.ActionTwo;

            ActionStateOne = (MTFiniteTimeActionState)ActionOne.StartAction(target);
            ActionStateTwo = (MTFiniteTimeActionState)ActionTwo.StartAction(target);
        }
示例#4
0
    void OnGUI()
    {
        if (GUILayout.Button ("MoveTo")) {
            resetObject ();
            var moveBy = new MTMoveBy(1,new Vector3(0,10,0));
            this.RunAction (moveBy);
        }

        if (GUILayout.Button("FadeOut"))
        {
            resetObject();
             var fadeOut = new MTFadeOut(2);
             this.RunActions(fadeOut);
        }

        if (GUILayout.Button ("FadeIn")) {
            resetObject ();
            var fadeIn = new MTFadeIn (2);
            this.RunAction (fadeIn);
        }

        if (GUILayout.Button("ScaleTo"))
        {
            resetObject();
            var scaleTo = new MTScaleTo(2,2,3,4);
            this.RunActions(scaleTo);

        }

        if(GUILayout.Button("JumpTo")){
            resetObject();
            var jumpTo = new MTJumpTo(2,new Vector3(0,0,0),2,3);
            this.RunAction(jumpTo);
        }

        if (GUILayout.Button ("Tint to")) {
            resetObject ();

            var TintTo = new MTTintTo (3f, 0.2f, 1f, 3f);

            this.RunAction (TintTo);

        }

        //		if (GUILayout.Button ("RotateTo")) {
        //			resetObject ();
        ////			var roTo = new MTRotateTo (2, 3,2,3);
        ////			this.RunAction (roTo);
        //
        //		}

        if (GUILayout.Button ("Sequence")) {
            resetObject ();
            var moveTo = new MTMoveTo (2, new Vector3 (10, 10, 10));
            var moveBy = new MTMoveBy(1,new Vector3(-1,1,-3));
            var jumpTo = new MTJumpTo(2,new Vector3(0,0,0),2,3);
            var TintTo = new MTTintTo (3f, 0.2f, 1f, 3f);

            this.RunActions(moveTo,moveBy,jumpTo,TintTo);

        }

        if (GUILayout.Button ("Spawn")) {
            resetObject ();

            var jumpTo = new MTJumpTo(2,new Vector3(0,0,0),2,3);
            var TintTo = new MTTintTo (3f, 0.2f, 1f, 3f);
        //			var roTo = new MTRotateTo (2, 3,2,3);
            var spawn = new MTSpawn(jumpTo,TintTo);

            this.RunActions(spawn);

        }

        if (GUILayout.Button("Hide"))
        {
            resetObject();
            var hide = new MTHide();
            this.RunActions(hide);
        }

        if (GUILayout.Button("Show"))
        {
            resetObject();
            var show = new MTShow();
            this.RunActions(show);
        }
    }
示例#5
0
        public MTSpawnState(MTSpawn action, GameObject target)
            : base(action, target)
        {
            ActionOne = action.ActionOne;
            ActionTwo = action.ActionTwo;

            ActionStateOne = (MTFiniteTimeActionState)ActionOne.StartAction (target);
            ActionStateTwo = (MTFiniteTimeActionState)ActionTwo.StartAction (target);
        }