Exemplo n.º 1
0
    //创建对象,导入各种预制体资源
    public void loadResources()
    {
        GameObject water = Instantiate(Resources.Load("Prefabs/Water",
                                                      typeof(GameObject)), new Vector3(0, 0.5F, 0), Quaternion.identity, null) as GameObject;

        water.name = "water";
        //设置控制器
        fromShore = new ShoreController("from");
        toShore   = new ShoreController("to");
        boat      = new BoatController();
        //导入游戏人物对象并设置控制器
        for (int i = 0; i < 3; i++)
        {
            MyCharacterController cha = new MyCharacterController("priest");
            cha.setName("priest" + i);
            cha.setPosition(fromShore.getEmptyPosition());
            cha.getOnShore(fromShore);
            fromShore.getOnShore(cha);

            characters[i] = cha;
        }

        for (int i = 0; i < 3; i++)
        {
            MyCharacterController cha = new MyCharacterController("devil");
            cha.setName("devil" + i);
            cha.setPosition(fromShore.getEmptyPosition());
            cha.getOnShore(fromShore);
            fromShore.getOnShore(cha);

            characters[i + 3] = cha;
        }
    }
Exemplo n.º 2
0
 public void reset()
 {
     moveableScript.reset();
     shoreController = (SSDirector.getInstance().currentSceneController as FirstController).fromShore;
     getOnShore(shoreController);
     setPosition(shoreController.getEmptyPosition());
     shoreController.getOnShore(this);
 }