Пример #1
0
    public static Commander CreateNewCmderAtZone(Zone targetZone, Faction ownerFac)
    {
        Commander newCmder = new Commander(ownerFac.ID, targetZone.ID);
        Cmder3d   cmd3d    = Cmder3dRecycler.GetACmderObj();

        cmd3d.transform.position = targetZone.MyZoneSpot.
                                   GetGoodSpotForCommander(GameController.GetCommandersInZone(targetZone).Count - 1);
        cmd3d.data = newCmder;
        cmd3d.RefreshDataDisplay();
        instance.spawnedCmders.Add(cmd3d);

        return(newCmder);
    }
Пример #2
0
    /// <summary>
    /// places all commanders stored in the current game data
    /// </summary>
    public static void SetupAllCommandersFromData()
    {
        Dictionary <Zone, int> placedCmdersInEachZone = new Dictionary <Zone, int>();

        foreach (Zone z in GameController.instance.curData.zones)
        {
            placedCmdersInEachZone.Add(z, 0);
        }
        List <Commander> cmders  = GameController.instance.curData.deployedCommanders;
        Cmder3d          cmd3d   = null;
        Zone             curZone = null;

        for (int i = 0; i < cmders.Count; i++)
        {
            cmd3d   = Cmder3dRecycler.GetACmderObj();
            curZone = GameController.GetZoneByID(cmders[i].zoneIAmIn);
            cmd3d.transform.position =
                curZone.MyZoneSpot.GetGoodSpotForCommander(placedCmdersInEachZone[curZone]);
            cmd3d.data = cmders[i];
            cmd3d.RefreshDataDisplay();
            instance.spawnedCmders.Add(cmd3d);
            placedCmdersInEachZone[curZone]++;
        }
    }
Пример #3
0
 protected override void Awake()
 {
     base.Awake();
     instance = this;
 }