Beispiel #1
0
    public void MoveCharacter(GameObject character, Vector3 target, float speed)
    {
        Vector3 forward, up, down;
        float   jumpDistance = target.x < 0 ? -8 : 8;

        List <SSAction> sequence;

        if (character.transform.position.y > target.y)
        {
            forward    = target;
            forward.x += jumpDistance;
            forward.y  = character.transform.position.y;
            down       = target;
            CCMoveToAction moveForward = CCMoveToAction.GetSSAction(forward, speed);
            CCMoveToAction jump        = CCMoveToAction.GetSSAction(down, speed);
            sequence = new List <SSAction> {
                moveForward, jump
            };
        }
        else
        {
            forward = target;
            up      = character.transform.position;
            up.x   += jumpDistance;
            up.y    = target.y;
            CCMoveToAction moveForward = CCMoveToAction.GetSSAction(forward, speed);
            CCMoveToAction jump        = CCMoveToAction.GetSSAction(up, speed);
            sequence = new List <SSAction> {
                jump, moveForward
            };
        }

        moveCharacter = SequenceAction.GetSSAcition(1, 0, sequence);
        RunAction(character, moveCharacter, this);
    }
Beispiel #2
0
    public void moveBoat(GameObject boat, Vector3 endPos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(endPos, speed);

        boatMove = SequenceAction.GetSSAcition(0, 0, new List <SSAction> {
            action1
        });
        this.RunAction(boat, boatMove, this);
    }
Beispiel #3
0
    public void moveRole(GameObject role, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(middle_pos, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(end_pos, speed);

        moveRoleToLandorBoat = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(role, moveRoleToLandorBoat, this);
    }
Beispiel #4
0
    public void moveCha(GameObject Cha, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(middle_pos, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(end_pos, speed);

        moveChaToCoastorBoat = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(Cha, moveChaToCoastorBoat, this);
    }
    public void moveRole(GameObject role, Vector3 middle_pos, Vector3 end_pos, float speed)
    {
        SSAction action1 = SSMoveToAction.GetSSAction(middle_pos, speed);         // GetSSAction添加动作到动作列表
        SSAction action2 = SSMoveToAction.GetSSAction(end_pos, speed);

        action_seq = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });                                            // 1, 0 对应动作是否重复等
        this.RunAction(role, action_seq, this);        //逐条执行动作
    }
Beispiel #6
0
    public void moveCharacter(GameObject ch, Vector3 middle, Vector3 dest, float speed)
    {
        //先到岸边,再上船
        SSAction action1 = SSMoveToAction.GetSSAction(middle, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(dest, speed);

        movech = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });                                                                                       //船动作组合
        this.RunAction(ch, movech, this);
    }
Beispiel #7
0
    public void moveRole(GameObject role, Vector3 middlePos, Vector3 endPos, float speed)
    {
        //两段移动
        SSAction action1 = SSMoveToAction.GetSSAction(middlePos, speed);
        SSAction action2 = SSMoveToAction.GetSSAction(endPos, speed);

        //repeat=1,start=0,两个动作
        roleMove = SequenceAction.GetSSAcition(1, 0, new List <SSAction> {
            action1, action2
        });
        this.RunAction(role, roleMove, this);
    }