Beispiel #1
0
    public void LoadResources()
    {
        //创建对象
        startCoast = new CoastModel("from");
        endCoast   = new CoastModel("to");
        boat       = new BoatModel();
        roles      = new RoleModel[6];
        GameObject water = Instantiate(Resources.Load("Perfabs/water", typeof(GameObject)), water_pos, Quaternion.identity, null) as GameObject;

        water.name = "water";
        for (int i = 0; i < 3; i++)
        {
            RoleModel priest = new RoleModel("priest");
            priest.setName("priest" + i);
            priest.setPos(startCoast.getEmptyPos());
            priest.getOnCoast(startCoast);
            startCoast.getOnCoast(priest);
            roles[i] = priest;
        }

        for (int i = 0; i < 3; i++)
        {
            RoleModel devil = new RoleModel("devil");
            devil.setName("devil" + i);
            devil.setPos(startCoast.getEmptyPos());
            devil.getOnCoast(startCoast);
            startCoast.getOnCoast(devil);
            roles[i + 3] = devil;
        }
    }
Beispiel #2
0
 public void LoadResources()
 {
     //载入游戏对象
     src        = new CoastModel(0);
     dst        = new CoastModel(1);
     river      = Instantiate <GameObject>(Resources.Load <GameObject>("prefabs/River"), new Vector3(0, 0.25f, 0), Quaternion.identity);
     river.name = "river";
     boat       = new BoatModel();
     for (int i = 0; i < 3; i++)
     {
         role[i] = new RoleModel(1);
         role[i].setPosition(new Vector3(-3.25f - 0.5f * i, 1.25f, 0));
         role[i].setName("priest" + i);
         role[i].getOnCoast(src);
         src.getOnCoast(role[i]);
     }
     for (int i = 3; i < 6; i++)
     {
         role[i] = new RoleModel(2);
         role[i].setPosition(new Vector3(-3.25f - 0.5f * i, 1.25f, 0));
         role[i].setName("devil" + i);
         role[i].getOnCoast(src);
         src.getOnCoast(role[i]);
     }
 }