void Awake () { TextAsset XMLTextAsset = (TextAsset) Resources.Load(levelPath + levelName); xmlDoc = new XmlDocument(); xmlDoc.LoadXml(XMLTextAsset.text); startingGold = int.Parse(xmlDoc.SelectSingleNode("/level/startingGold").InnerText); entityFactory = EntityFactory.GetInstance(); monsterGUIManager = GameObject.Find("MonsterGUIManager").GetComponent<MonsterGUIManager>(); waveManager = GameObject.Find("WaveManager").GetComponent<HeroWaveManager>(); if (playerStatusManager == null) playerStatusManager = GameObject.Find("PlayerStatusManager").GetComponent<PlayerStatusManager>(); //waveManager.onSpawnNewHero += HandleOnSpawnNewHero; waveManager.onWaveCompletedSpawning += HandleOnWaveCompletedSpawning; waveManager.onAllWaveEnemiesDefeated += HandleOnWaveEnemiesDefeated; waveManager.onNextWaveStarted += HandleOnNextWaveStarted; }
void Awake() { monsterGUIManager = GameObject.Find("MonsterGUIManager").GetComponent<MonsterGUIManager>(); }
void Start() { if (spawnLocation == Vector3.zero) spawnLocation = transform.FindChild("SpawnLocation").transform.position; if (monsterGUIManager == null) monsterGUIManager = GameObject.Find("MonsterGUIManager").GetComponent<MonsterGUIManager>(); if (playerStatusManager == null) playerStatusManager = GameObject.Find("PlayerStatusManager").GetComponent<PlayerStatusManager>(); currentSpawnSpeedMultiplier = baseSpawnSpeedMultiplier; monsterIndicators = new tk2dSprite[5]; monsterIndicators[0] = transform.FindChild("monsterIndicators").FindChild("1").GetComponent<tk2dSprite>(); monsterIndicators[1] = transform.FindChild("monsterIndicators").FindChild("2").GetComponent<tk2dSprite>(); monsterIndicators[2] = transform.FindChild("monsterIndicators").FindChild("3").GetComponent<tk2dSprite>(); monsterIndicators[3] = transform.FindChild("monsterIndicators").FindChild("4").GetComponent<tk2dSprite>(); monsterIndicators[4] = transform.FindChild("monsterIndicators").FindChild("5").GetComponent<tk2dSprite>(); levelManager = GameObject.Find("LevelManager").GetComponent<LevelManager>(); entityFactory = EntityFactory.GetInstance(); viewCamera = GameObject.Find("Main Camera").GetComponent<Camera>(); selectionCollider = transform.FindChild("SelectCollider").GetComponent<Collider>(); spawnCollider = transform.FindChild("SpawnCollider").GetComponent<SpawnCollider>(); totalSpawned = 0; totalAlive = 0; sprite = transform.FindChild("MonsterSprite").GetComponent<tk2dSprite>(); dungeonSprite = GetComponent<tk2dSprite>(); canSell = false; }