// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-11-25 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace G { /// /// 战斗编辑器 /// public class BattleEditor : KUIWidget { #if UNITY_EDITOR || DEBUG_MY /// /// /// public class TextWidget : KUIWidget { Text _text; public override void Refresh() { if (this.data is ItemMinion minion) { if (!string.IsNullOrEmpty(minion.name)) _text.text = minion.name; else _text.text = $"小兵{minion.id}"; return; } if (this.data is ItemBoss boss) { if (!string.IsNullOrEmpty(boss.name)) _text.text = boss.name; else _text.text = $"首领{boss.id}"; return; } if (this.data is ItemMoves moves) { _text.text = moves.name; return; } if (this.data is ItemLevel level) { _text.text = level.name; return; } } void OnClick() { if (this.data is ItemMinion minion) { _Instance.SpawnMinion(minion.id, 0); return; } if (this.data is ItemBoss boss) { _Instance.SpawnBoss(boss.id, 0); return; } if (this.data is ItemMoves moves) { _Instance.StudySkill(moves.id); return; } if (this.data is ItemLevel level) { _Instance.ReplaceScene(level.assets[0]); return; } } private void Awake() { _text = Find("Text"); GetComponent