Ejemplo n.º 1
0
 void ModifyFog(float[,] alphaMap, FogAgent fogAgent)
 {
     if (fogAgent != null)
     {
         ModifyFog(alphaMap, fogAgent.position, fogAgent.sightRadius, fogAgent.strength);
     }
 }
Ejemplo n.º 2
0
 void ModifyFog(float[,] alphaMap, FogAgent fogAgent)
 {
     if (fogAgent != null && fogAgent.Rect.Intersects(currentArea))
     {
         ModifyFog(alphaMap, fogAgent.Position, fogAgent.SightRadius, fogAgent.Strength, fogAgent.Falloff, fogAgent.Inverted);
     }
 }
Ejemplo n.º 3
0
    void makeAgent(Transform agentTranform, int radius, int playerId)
    {
        FogAgent fogAgent = new FogAgent(agentTranform, radius);

        if (playerId != NetworkController.instance.clientController.playerId)
        {
            fogAgentToRemove.Add(fogAgent);
        }
        References.Fow.AddAgent(fogAgent);
    }
Ejemplo n.º 4
0
        public FogAgent GetAgent(int index)
        {
            FogAgent agent = null;

            try {
                agent = fogAgents[index];
            }
            catch {
                Logger.LogError(string.Format("Fog agent at index {0} could not be found.", index));
            }

            return(agent);
        }
Ejemplo n.º 5
0
    void UpdateAlphaMap(float[,] alphaMap)
    {
        FogAgent[] troopAgents = new FogAgent[troopFogAgents.Length];
        troopFogAgents.CopyTo(troopAgents, 0);

        for (int i = troopAgents.Length - 1; i >= 0; i--)
        {
            ModifyFog(alphaMap, troopAgents[i]);
        }

        for (int i = fogAgents.Count - 1; i >= 0; i--)
        {
            ModifyFog(alphaMap, fogAgents[i]);
        }
    }
Ejemplo n.º 6
0
    void UpdateAgents()
    {
        TroopBase[] troops = TroopManager.GetTroops(NetworkController.CurrentPlayerId);
        troopFogAgents = new FogAgent[troops.Length];

        for (int i = 0; i < troops.Length; i++)
        {
            TroopBase troop = troops[i];
            troopFogAgents[i] = new FogAgent(troop.transform, troop.sightRadius * 2);
        }

        foreach (FogAgent fogAgent in fogAgents)
        {
            fogAgent.Update();
        }
    }
Ejemplo n.º 7
0
 public void RemoveAgent(FogAgent agent)
 {
     fogAgents.Remove(agent);
     UpdateFow = true;
 }
Ejemplo n.º 8
0
 public void AddAgent(FogAgent agent)
 {
     fogAgents.Add(agent);
     UpdateFow = true;
 }