void ShowTooltip(Ability ability) { lbTooltipName.text = ability.name; lbTooltipDesp.text = ability.GetDesp(); tooltipRscItem.label.text = ability.GetCost().ToString("f0"); //~ List<int> cost=tower.GetCost(); //~ for(int i=0; i<tooltipRscItemList.Count; i++){ //~ tooltipRscItemList[i].label.text=cost[i].ToString(); //~ } tooltipCanvasG.alpha = 1; tooltipObj.SetActive(true); }
public void OnHoverAbilityButton(GameObject butObj) { if (GameControl.GetSelectedTower() != null) { return; } int ID = GetButtonID(butObj); Ability ability = AbilityManager.GetAbilityList()[ID]; txtTooltipName.text = ability.name; txtTooltipCost.text = "" + ability.GetCostInt(); txtTooltipDesp.text = ability.GetDesp(); tooltipObj.SetActive(true); }