private void OnEnable() { int j = 0; transform.GetChild((int)SelectBattleCharactersScreenChildren.Header).GetComponentInChildren <Text>().text = Translater.BattleCharacterSelection(); foreach (PawnInstance ki in TileManager.Instance.KeepersOnTile[activeTile]) { if (ki.Data.Behaviours[(int)BehavioursEnum.Archer] == true) { continue; } GameObject kiImage = Instantiate(imagePrefab, transform.GetChild((int)SelectBattleCharactersScreenChildren.CharactersOnTile).GetChild(j)); kiImage.AddComponent <UIKeeperInstance>(); kiImage.GetComponent <UIKeeperInstance>().keeperInstance = ki; kiImage.AddComponent <DragHandler>(); kiImage.AddComponent <CanvasGroup>(); kiImage.transform.localScale = Vector3.one; kiImage.transform.localPosition = Vector3.zero; kiImage.GetComponent <Image>().sprite = ki.Data.AssociatedSprite; j++; } PawnInstance archer = GameManager.Instance.ArcherInstance; if (archer != null && archer.CurrentTile == activeTile) { GameObject kiImage = Instantiate(imagePrefab, transform.GetChild((int)SelectBattleCharactersScreenChildren.CharactersOnTile).GetChild(j)); kiImage.AddComponent <UIKeeperInstance>(); kiImage.GetComponent <UIKeeperInstance>().keeperInstance = archer; kiImage.AddComponent <DragHandler>(); kiImage.AddComponent <CanvasGroup>(); kiImage.transform.localScale = Vector3.one; kiImage.transform.localPosition = Vector3.zero; kiImage.GetComponent <Image>().sprite = archer.Data.AssociatedSprite; } if (TileManager.Instance.PrisonerTile != null && TileManager.Instance.PrisonerTile == activeTile) { isPrisonerOnTile = true; GameObject kiImage = Instantiate(imagePrefab, transform.GetChild((int)SelectBattleCharactersScreenChildren.CharactersSelected).GetChild(2)); kiImage.transform.localScale = Vector3.one; kiImage.transform.localPosition = Vector3.zero; kiImage.GetComponent <Image>().sprite = GameManager.Instance.PrisonerInstance.Data.AssociatedSprite; } else { isPrisonerOnTile = false; } // TODO load monsters on tile in UI (sprites only) }