Ejemplo n.º 1
0
            public static Action getAction(int _i, Passenger[] _passenger, Boat _boat, Callback callback)
            {
                List <Action> list = new List <Action>();

                list.Add(Action_MoveTo.getAction(
                             _passenger[_i].gameobject(),
                             aboardPoint(_boat.CoastPos == CoastPos.BoatLeft),
                             0.2f,
                             callback
                             ));

                list.Add(Action_MoveTo.getAction(
                             _passenger[_i].gameobject(),
                             passengerOnCoast(_i, _passenger[_i].type, _passenger[_i].CoastPos == CoastPos.CoastLeft),
                             0.5f,
                             callback
                             ));

                for (int i = 0; i != 6; ++i)
                {
                    if (_passenger[i].CoastPos == CoastPos.BoatLeft || _passenger[i].CoastPos == CoastPos.BoatRight)
                    {
                        list.Add(Action_MoveTo.getAction(
                                     _passenger[i].gameobject(),
                                     _boat.gameobject().transform.position + new Vector3(-1, 0.75f, 0),
                                     0.2f,
                                     callback
                                     ));
                    }
                }
                Action ac = SequenceAction.getAction(list, callback);

                return(ac);
            }
Ejemplo n.º 2
0
    public void getOnBoat(GameObject people, int shore, int seat)
    {
        if (shore == 0 && seat == 0)
        {
            horizontal = MoveToAction.getAction(new Vector3(-5f, 2.7f, 0), speed); //右移
            vertical   = MoveToAction.getAction(new Vector3(-5f, 1.2f, 0), speed); //下移
        }
        else if (shore == 0 && seat == 1)
        {
            horizontal = MoveToAction.getAction(new Vector3(-3f, 2.7f, 0), speed); //右移
            vertical   = MoveToAction.getAction(new Vector3(-3f, 1.2f, 0), speed); //下移
        }
        else if (shore == 1 && seat == 0)
        {
            horizontal = MoveToAction.getAction(new Vector3(3f, 2.7f, 0), speed); //左移
            vertical   = MoveToAction.getAction(new Vector3(3f, 1.2f, 0), speed); //下移
        }
        else if (shore == 1 && seat == 1)
        {
            horizontal = MoveToAction.getAction(new Vector3(5f, 2.7f, 0), speed); //左移
            vertical   = MoveToAction.getAction(new Vector3(5f, 1.2f, 0), speed); //下移
        }

        SequenceAction saction = SequenceAction.getAction(0, 0, new List <SSAction> {
            horizontal, vertical
        });                                                                                                  //将动作组合

        this.Action(people, saction, this);
    }
Ejemplo n.º 3
0
    public void getOffBoat(GameObject people, int shoreNum)
    {
        horizontal = MoveToAction.getAction(new Vector3(people.transform.position.x, 2.7f, 0), speed);//上移

        if (shoreNum == 0)
        {
            vertical = MoveToAction.getAction(new Vector3(-16f + 1.5f * Convert.ToInt32(people.name), 2.7f, 0), speed);               //左移
        }
        else
        {
            vertical = MoveToAction.getAction(new Vector3(16f - 1.5f * Convert.ToInt32(people.name), 2.7f, 0), speed); //右移
        }
        SequenceAction saction = SequenceAction.getAction(0, 0, new List <SSAction> {
            horizontal, vertical
        });                                                                                                  //将动作组合

        this.Action(people, saction, this);
    }
Ejemplo n.º 4
0
            public static Action getAction(int _i, Passenger[] _passenger, Boat _boat, Callback callback)
            {
                List <Action> list = new List <Action>();

                list.Add(Action_MoveTo.getAction(
                             _passenger[_i].gameobject(),
                             aboardPoint(_boat.CoastPos == CoastPos.BoatLeft),
                             0.2f,
                             callback
                             ));
                list.Add(Action_MoveTo.getAction(
                             _passenger[_i].gameobject(),
                             dist(_passenger, _boat),
                             0.2f,
                             callback
                             ));
                Action ac = SequenceAction.getAction(list, callback);

                return(ac);
            }
Ejemplo n.º 5
0
    public void moveCharacter(MyCharacterController character, Vector3 target)
    {
        Vector3 nowPos = character.getPos();
        Vector3 tmpPos = nowPos;

        if (target.y > nowPos.y)
        {
            tmpPos.y = target.y;
        }
        else
        {
            tmpPos.x = target.x;
        }
        SSAction action1        = MoveAction.getAction(tmpPos, character.speed);
        SSAction action2        = MoveAction.getAction(target, character.speed);
        SSAction sequenceAction = SequenceAction.getAction(1, 0, new List <SSAction> {
            action1, action2
        });

        this.addAction(character.getInstance(), sequenceAction, this);
    }
Ejemplo n.º 6
0
    public void addRandomAction(GameObject gameObj, float speed)
    {
        Vector3 currentPos    = gameObj.transform.position;
        Vector3 randomTarget1 = new Vector3(
            Random.Range(currentPos.x - 7, currentPos.x + 7),
            Random.Range(1, currentPos.y + 5),
            Random.Range(currentPos.z - 7, currentPos.z + 7)
            );
        MoveToAction moveAction1 = MoveToAction.getAction(randomTarget1, speed);

        Vector3 randomTarget2 = new Vector3(
            Random.Range(currentPos.x - 7, currentPos.x + 7),
            Random.Range(1, currentPos.y + 5),
            Random.Range(currentPos.z - 7, currentPos.z + 7)
            );
        MoveToAction moveAction2 = MoveToAction.getAction(randomTarget2, speed);

        SequenceAction sequenceAction = SequenceAction.getAction(new List <ObjAction> {
            moveAction1, moveAction2
        }, -1);

        addAction(gameObj, sequenceAction, this);
    }
Ejemplo n.º 7
0
    static public Action getAction(int roundNum)
    {
        List <Action> acList = new List <Action>();

        acList.Add(roundHint.getAction(roundNum));
        switch (roundNum)
        {
        case 1:
            for (int times = 3; times-- != 0;)
            {
                acList.Add(ThrowUFO.getAction(1, 20));
            }
            break;

        case 2:
            for (int times = 3; times-- != 0;)
            {
                acList.Add(ThrowUFO.getAction(2, 20));
            }
            break;

        case 3:
            for (int times = 5; times-- != 0;)
            {
                acList.Add(ThrowUFO.getAction(5, 30));
            }
            break;

        case 4:
            for (int times = 10; times-- != 0;)
            {
                acList.Add(ThrowUFO.getAction(5, 40));
            }
            break;
        }
        return(SequenceAction.getAction(acList));
    }