/// <summary> /// Adds a monster GO to the enemy canvas, initializing its values and setting navigation /// </summary> /// <param name="monsterName"> Name of the monster to be fetched from the DB </param> /// <remark> Assumes there will always be an action at button 0 </remark> private IEnumerator AddMonster(string monsterName) { GameObject newMonster = Instantiate(DataManager.instance.GetLoadedMonster(monsterName)); newMonster.SetActive(true); Monster monsterComponent = newMonster.GetComponent <Monster>(); SelectMonsterDelegate smd = new SelectMonsterDelegate(SelectMonster); monsterComponent.ID = countID++; monsterComponent.SetHealthBar(); monsterComponent.AddSMDListener(smd); monsterComponent.SetNavigation("down", actionsPanel.GetActionButton(0)); newMonster.transform.SetParent(enemyCanvas.transform, false); monsters.Add(monsterComponent); yield break; }