Пример #1
0
    void CreateDepots(GameObject player)
    {
        DepotManager depotManager = player.GetComponent <DepotManager> ();
        DeckManager  deckManager  = player.GetComponent <DeckManager> ();

        Vector3[] positions = GetDepotPositions(player);

        for (int i = 0; i < (depotManager.ammoDepotNumber + depotManager.woodDepotNumber); i++)
        {
            if (depotManager.ammoDepotsCreated < depotManager.ammoDepotNumber)
            {
                GameObject depotToDeploy = depotManager.CreateAmmoDepot(player.transform);
                int        xPos          = (int)positions [i].x;
                int        zPos          = (int)positions [i].z;
                depotToDeploy.GetComponent <Depot> ().PlaceDepot(deckManager.RetrieveTile(xPos, zPos));
                depotManager.ammoDepotsCreated += 1;
            }
            else
            {
                GameObject depotToDeploy = depotManager.CreateWoodDepot(player.transform);
                int        xPos          = (int)positions [i].x;
                int        zPos          = (int)positions [i].z;
                depotToDeploy.GetComponent <Depot> ().PlaceDepot(deckManager.RetrieveTile(xPos, zPos));
                depotManager.woodDepotsCreated += 1;
            }
        }
    }
Пример #2
0
    public void SetUpWoodDepot()
    {
        DepotManager depotManager = activePlayer.GetComponent <DepotManager> ();

        if (depotManager.woodDepotsCreated < depotManager.woodDepotNumber)
        {
            woodDepotToDeploy = depotManager.CreateWoodDepot(this.transform);
        }
    }