public void SetSelectedObject(HeroInfo gameObject) { if (gameObject == this.selectedObject) { this.selectedObject = null; TitleText.text = "Unit Info (?)"; AttackText.text = "Attack (?)"; DeffenseText.text = "Deffense (?)"; MoveText.text = "Move (?)"; RangeText.text = "Range (?)"; HealthText.text = "Health (?)"; return; } this.selectedObject = gameObject; HeroInfo heroInfo = selectedObject.GetComponent <HeroInfo> (); if (heroInfo != null) { TitleText.text = "Unit Info (" + heroInfo.player + ")"; AttackText.text = "Attack (" + heroInfo.damage + ")"; DeffenseText.text = "Deffense (" + heroInfo.deffense + ")"; MoveText.text = "Move (" + heroInfo.move + ")"; RangeText.text = "Range (" + heroInfo.range + ")"; HealthText.text = "Health (" + heroInfo.health + ")"; } }
private void Update() { if (!turnManager || !GameObject.Find("Characters")) { return; } if (CharacterSelectionManager.LegendChoice) { info = CharacterSelectionManager.TheHeroInfo; abilities = info.GetComponent <HeroAbilities>(); loreInfoText.text = Options.Japanese ? info.roaa : info.Lore; abilityInfoText.text = abilities.GetAbilityInfo; } if (start || NoStart || InGameInfo || LoreInfo) { if (CharacterSelectionManager.Instance.Available[turnManager.CurrentInt]) { start.SetActive(true); NoStart.SetActive(false); InGameInfo.SetActive(true); LoreInfo.SetActive(true); abilityInfo.SetActive(true); aIcon.Force(); hIcon.Force(); iconsPanel.SetActive(true); SetGameInfo(); } else { start.SetActive(false); NoStart.SetActive(true); InGameInfo.SetActive(false); LoreInfo.SetActive(false); abilityInfo.SetActive(false); iconsPanel.SetActive(false); characterName.text = Options.Japanese ? "名前無し" : "NoName"; } } }