void Start() { if (!AbilityManager.IsOn() || AbilityManager.GetAbilityCount() == 0) { thisObj.SetActive(false); return; } List <Ability> abList = AbilityManager.GetAbilityList(); for (int i = 0; i < abList.Count; i++) { if (i == 0) { buttonList[0].Init(); } else if (i > 0) { buttonList.Add(UIButton.Clone(buttonList[0].rootObj, "AbilityButton" + (i + 1))); } buttonList[i].imgIcon.sprite = abList[i].icon; buttonList[i].imgHighlight.enabled = false; buttonList[i].label.text = ""; if (abList[i].usedRemained > 0) { buttonList[i].label.text = abList[i].usedRemained.ToString(); } //else buttonList[i].label.text="∞"; if (UIMainControl.InTouchMode()) { buttonList[i].SetCallback(null, null, this.OnAbilityButton, null); } else { buttonList[i].SetCallback(this.OnHoverButton, this.OnExitButton, this.OnAbilityButton, null); } } tooltipRscItem.Init(); butCancelCanvasG = butCancelObj.AddComponent <CanvasGroup>(); OnAbilitySelectingTarget(false); UIItemCallback cancelCallback = butCancelObj.AddComponent <UIItemCallback>(); cancelCallback.SetDownCallback(this.OnCancelAbilityButton); //cancelCallback.SetUpCallback(up); tooltipObj.SetActive(false); }