예제 #1
0
        public static CCSequenceAction GetSSAction(int repeat, int start, List <SSAction> sequence)
        {
            CCSequenceAction action = ScriptableObject.CreateInstance <CCSequenceAction>();

            action.repeat   = repeat;
            action.start    = start;
            action.sequence = sequence;
            return(action);
        }
예제 #2
0
        public void moveCharacter(zyzCharacterController characterController, Vector3 dest)
        {
            Vector3 curPos = characterController.getPosition();
            Vector3 midPos = curPos;

            if (dest.y > curPos.y)
            {
                midPos.y = dest.y;
            }
            else
            {
                midPos.x = dest.x;
            }
            SSAction action1   = CCMoveToAction.GetSSAction(midPos, characterController.speed);
            SSAction action2   = CCMoveToAction.GetSSAction(dest, characterController.speed);
            SSAction seqAction = CCSequenceAction.GetSSAction(1, 0, new List <SSAction> {
                action1, action2
            });

            this.RunAction(characterController.getGameObject(), seqAction, this);
        }