private void Start() { rend = GetComponent <Renderer>(); if (rend == null) { IDebug.LogError("\"" + this.name + "\" could not find its renderer."); return; } startColor = rend.material.color; }
/// <summary> /// Used to handle any spawn messages sent to this TowerSpawnPoint /// </summary> /// <param name="TTS">The tower to spawn. Must have a TowerBase component on its highest parent</param> void SPAWNTOWER_MSG(GameObject TTS) { if (TTS.GetComponent <TowerBase>() != null) { m_towerToSpawn = TTS; if (SpawnTower() == false) { IDebug.LogError("Attempt to spawn tower at spawn point \"" + this.name + "\" has failed for an unknown reason."); } return; } IDebug.LogError("Attempt to spawn tower at spawn point \"" + this.name + "\" has failed because the TowerBase component could not be found on the highest parent."); }
public override void Awake() { base.Awake(); if (StartDestination != null) { m_navMeshAgent = Agent; } else { IDebug.LogError("EnemyBase " + m_name + ": NavMeshAgent was not set on this object!"); } if (StartDestination != null) { m_destination = StartDestination; } }
/// <summary> /// Handles all query messages /// </summary> /// <param name="IDToQuery"></param> public void OnMessageRecieved(int IDToQuery, TowerSpawnPoint TSP) { IDebug.DebugVerbose("\"" + this.name + "\" has recieved a message: \"" + IDToQuery + "\" with TowerSpawnPoint \"" + TSP.name + "\"."); GameObject Obj; try { Obj = Database[IDToQuery]; } catch { IDebug.LogError("TowerDatabaseManager (\"" + this.name + "\") does not have a entry with the ID \"" + IDToQuery + "\"."); return; } MsgJunction.instance.SendTowerSpawnMsg("SPAWN_TOWER", TSP, Obj); }
private void Awake() { if (instance != this) { instance = this; } if (UIMsgReciever == null) { IDebug.LogError("MsgJunction (\"" + this.name + "\") does not have a reference to the UI message reciever."); } if (TSHMReciever == null) { IDebug.LogError("MsgJunction (\"" + this.name + "\") does not have a reference to the highlight message reciever."); } if (TDMReciever == null) { IDebug.LogError("MsgJunction (\"" + this.name + "\") does not have a reference to the Tower Database message reciever."); } }