void ModifyFog(float[,] alphaMap, FogAgent fogAgent) { if (fogAgent != null) { ModifyFog(alphaMap, fogAgent.position, fogAgent.sightRadius, fogAgent.strength); } }
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); } }
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); }
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); }
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]); } }
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(); } }
public void RemoveAgent(FogAgent agent) { fogAgents.Remove(agent); UpdateFow = true; }
public void AddAgent(FogAgent agent) { fogAgents.Add(agent); UpdateFow = true; }