示例#1
0
 public void Wololo(GameObject oldFactionChief, uint newFaction)
 {
     if (factionEntity.ContainsKey(oldFactionChief))
     {
         foreach (GameObject go in factionEntity[oldFactionChief])
         {
             ZombieFaction zf = go.GetComponent <ZombieFaction>();
             zf.SetFaction(newFaction);
         }
     }
 }
示例#2
0
    public void AddEntity(uint faction, GameObject entity)
    {
        GameObject factionChief = null;

        foreach (GameObject go in factionEntity.Keys)
        {
            if (go == null)
            {
                continue;
            }
            ZombieFaction zf = go.GetComponent <ZombieFaction>();
            //Debug.Log(zf);
            if (zf != null && zf.faction == faction)
            {
                factionChief = go;
                break;
            }
        }
        if (factionChief != null)
        {
            factionEntity[factionChief].Add(entity);
        }
    }