//helper function
    public void PlayerCreateShip()
    {
        Debug.Log("create ship for player");
        ShipScript ship = planetScript.CreateShip(AbstractPlanet.Ownership.Player);

        if (ship != null)
        {
            ManagerScript.Instance.audioManager.PlaySound("ButtonClick");
            planetScript.LoadSoldiersToShip(ship);
        }
    }
Esempio n. 2
0
 void PlanetActions(AbstractPlanet planet)
 {
     //Always create units
     CreateUnits(planet);
     //Always send units to neighboring planets once ship capacity is met
     //Create ship
     planet.CreateShip(AbstractPlanet.Ownership.Enemy);
     //Load Units to ship
     planet.LoadSoldiersToShip(planet.ships[Indices.SHIP_ENEMY]);
     //Load Soldiers Units until ship capacity is met
     if ((planet.enemySoldiers == 0 && planet.ships[Indices.SHIP_ENEMY].soldiersOnBoard > 0) ||
         planet.ships[Indices.SHIP_ENEMY].soldiersOnBoard >= planet.ships [Indices.SHIP_ENEMY].soldierCapacity)
     {
         //Send units to a neighboring planet
         neighboringPlanet = ChoosePlanet(planet);
         //Launch Ship to neighboring planet
         LaunchShip(planet, neighboringPlanet, planet.adjacentPaths, planet.ships [Indices.SHIP_ENEMY]);
     }
 }