本文整理汇总了C#中TDTK.UnitTower.ReadyToBeUpgrade方法的典型用法代码示例。如果您正苦于以下问题:C# UnitTower.ReadyToBeUpgrade方法的具体用法?C# UnitTower.ReadyToBeUpgrade怎么用?C# UnitTower.ReadyToBeUpgrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDTK.UnitTower
的用法示例。
在下文中一共展示了UnitTower.ReadyToBeUpgrade方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _Show
public void _Show(UnitTower tower, bool showControl=false)
{
isOn=true;
thisObj.SetActive(showControl);
floatingButtons.SetActive(showControl);
controlObj.SetActive(showControl);
rscObj.SetActive(!showControl);
currentTower=tower;
if(showControl){
if(currentTower.IsInConstruction()){
StartCoroutine(WaitForConstruction());
floatingButtons.SetActive(false);
}
upgradeOption=currentTower.ReadyToBeUpgrade();
if(upgradeOption>0){
butUpgrade.SetActive(true);
}
else{
butUpgrade.SetActive(false);
}
// deactivate the priority settings for support and electricity towers
if (tower.type != _TowerType.Turret)
{
priorityObj.SetActive(false);
}
}
else{
List<int> cost=currentTower.GetCost();
for(int i=0; i<rscObjList.Count; i++){
rscObjList[i].label.text=cost[i].ToString();
}
}
Update();
txtName.text=tower.unitName;
txtLvl.text="lvl "+tower.GetLevel();
txtDesp1.text=tower.GetDespStats();
txtDesp2.text=tower.GetDespGeneral();
thisObj.SetActive(isOn);
}
示例2: _Show
public void _Show(UnitTower tower, bool showControl=false){
isOn=true;
thisObj.SetActive(showControl);
floatingButtons.SetActive(showControl);
controlObj.SetActive(showControl);
rscObj.SetActive(!showControl);
currentTower=tower;
if(showControl){
if(currentTower.IsInConstruction()){
StartCoroutine(WaitForConstruction());
floatingButtons.SetActive(false);
}
upgradeOption=currentTower.ReadyToBeUpgrade();
if(upgradeOption>0){
butUpgrade.SetActive(true);
if(upgradeOption>1) butUpgradeAlt1.SetActive(true);
else butUpgradeAlt1.SetActive(false);
}
else{
butUpgrade.SetActive(false);
butUpgradeAlt1.SetActive(false);
}
txtTargetPriority.text=tower.targetPriority.ToString();
if(tower.directionalTargeting){
directionObj.SetActive(true);
sliderDirection.value=tower.dirScanAngle;
}
else directionObj.SetActive(false);
if(FPSControl.ActiveInScene()){
if(FPSControl.UseTowerWeapon() && currentTower.FPSWeaponID==-1)
fpsButtonObj.SetActive(false);
else fpsButtonObj.SetActive(true);
}
else fpsButtonObj.SetActive(false);
}
else{
List<int> cost=currentTower.GetCost();
for(int i=0; i<rscObjList.Count; i++){
rscObjList[i].label.text=cost[i].ToString();
}
}
Update();
txtName.text=tower.unitName;
txtLvl.text="lvl"+tower.GetLevel();
txtDesp1.text=tower.GetDespStats();
txtDesp2.text=tower.GetDespGeneral();
thisObj.SetActive(isOn);
}