//人上船
    public void getOnBoat(GameObject people, int shore, int seat)
    {
        if (shore == 0 && seat == 0)
        {
            action1 = MoveToAction.GetAction(new Vector3(-5f, people.transform.position.y, 0), speed);
            action2 = MoveToAction.GetAction(new Vector3(-5f, 0.5f, 0), speed);
        }
        else if (shore == 0 && seat == 1)
        {
            action1 = MoveToAction.GetAction(new Vector3(-3f, people.transform.position.y, 0), speed);
            action2 = MoveToAction.GetAction(new Vector3(-3f, 0.5f, 0), speed);
        }
        else if (shore == 1 && seat == 0)
        {
            action1 = MoveToAction.GetAction(new Vector3(3f, people.transform.position.y, 0), speed);
            action2 = MoveToAction.GetAction(new Vector3(3f, 0.5f, 0), speed);
        }
        else if (shore == 1 && seat == 1)
        {
            action1 = MoveToAction.GetAction(new Vector3(5f, people.transform.position.y, 0), speed);
            action2 = MoveToAction.GetAction(new Vector3(5f, 0.5f, 0), speed);
        }

        SequenceAction saction = SequenceAction.GetAction(0, 0, new List <SSAction> {
            action1, action2
        });

        this.RunAction(people, saction, this);
    }
예제 #2
0
    public Action MoveAround(GameObject prop, int sign)
    {
        Vector3 position = new Vector3((sign - 1) / 3 * 10 - 10, 0, (sign - 1) % 3 * 10 - 10);
        Action  action1  = MoveToAction.GetAction(new Vector3(position.x - 2f, 0, position.z - 2f), speed);
        Action  action2  = MoveToAction.GetAction(new Vector3(position.x - 2f, 0, position.z + 2f), speed);
        Action  action3  = MoveToAction.GetAction(new Vector3(position.x + 2f, 0, position.z + 2f), speed);
        Action  action4  = MoveToAction.GetAction(new Vector3(position.x + 2f, 0, position.z - 2f), speed);
        Action  sequence = SequenceAction.GetAction(-1, 0, speed, new List <Action> {
            action1, action2, action3, action4
        });

        AddAction(prop, sequence, this);
        return(sequence);
    }
    //人下船
    public void getOffBoat(GameObject people, int shoreNum)
    {
        action1 = MoveToAction.GetAction(new Vector3(people.transform.position.x, 2.5f, 0), speed);//人向上移动

        if (shoreNum == 0)
        {
            action2 = MoveToAction.GetAction(new Vector3(-6f - sceneController.distanceBetweenObj * Convert.ToInt32(people.name), 2.5f, 0), speed);               //人向左移动
        }
        else
        {
            action2 = MoveToAction.GetAction(new Vector3(6f + sceneController.distanceBetweenObj * Convert.ToInt32(people.name), 2.5f, 0), speed); //人向右移动
        }
        SequenceAction saction = SequenceAction.GetAction(0, 0, new List <SSAction> {
            action1, action2
        });

        this.RunAction(people, saction, this);
    }