当前位置: 首页>>代码示例>>C#>>正文


C# UnitTower.ReadyToBeUpgrade方法代码示例

本文整理汇总了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);
        }
开发者ID:toooooooo,项目名称:BEER,代码行数:47,代码来源:UITowerInfo.cs

示例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);
		}
开发者ID:ahvdesign,项目名称:Tower-Defense-Q,代码行数:57,代码来源:UITowerInfo.cs


注:本文中的TDTK.UnitTower.ReadyToBeUpgrade方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。