Example #1
0
 public void setUpFor(int playerId)
 {
     foreach (var spawnner in spawnners)
     {
         spawnner.GetComponentInChildren <Light>().color = TeamStaticStuff.getColorForTeam(playerId);
     }
     superHedronCollider.GetComponentInChildren <Light>().color = TeamStaticStuff.getColorForTeam(playerId);
 }
Example #2
0
    public static TroopBase Spawn(int playerId, int troopId, int troopTypeId, Vector3 position, Quaternion rotation)
    {
        TroopBase troop = hObjectPool.Instance.Spawn(TypeIdToPrefab(troopTypeId), position, rotation).GetComponent <TroopBase>();

        if (!playerIdTroopDict.ContainsKey(playerId))
        {
            playerIdTroopDict[playerId] = new PlayerTroopManager(playerId);
        }

        troop.childLight.enabled = false;
        troop.gameObject.layer   = playerId == NetworkController.CurrentPlayerId ? 9 : 10;
        troop.playerId           = playerId;
        troop.id = troopId;
        troop.childLight.color = TeamStaticStuff.getColorForTeam(playerId);
        playerIdTroopDict[playerId].AddTroop(troop);

        References.Fow.UpdateFow = true;

        return(troop);
    }