Пример #1
0
        public void UpdateDisplay()
        {
            if (currentTower == null)
            {
                return;
            }

            lbTowerName.text  = currentTower.unitName;
            lbTowerLevel.text = "lvl" + currentTower.GetLevel();
            lbTowerDesp1.text = "damage: " + currentTower.GetDamageMin() + "-" + currentTower.GetDamageMax();
            lbTowerDesp1.text = currentTower.GetDespStats();          //"damage: "+currentTower.GetDamageMin()+"-"+currentTower.GetDamageMax();
            lbTowerDesp2.text = currentTower.GetDespGeneral();


            sliderDrection.value = currentTower.dirScanAngle;
            directionControlObj.SetActive(currentTower.directionalTargeting);


            int upgradeOption = currentTower.ReadyToBeUpgrade();

            butUpgrade1Canvas.alpha        = upgradeOption >= 1 ? 1 : 0;
            butUpgrade1Canvas.interactable = upgradeOption >= 1 ? true : false;
            butUpgrade2Canvas.alpha        = upgradeOption >= 2 ? 1 : 0;
            butUpgrade2Canvas.interactable = upgradeOption >= 2 ? true : false;
            //butUpgradeObj1.SetActive(upgradeOption>=1 ? true : false);
            //butUpgradeObj2.SetActive(upgradeOption>=2 ? true : false);

            butSellObj.SetActive(currentTower.canBeSold);

            bool enableFPS = FPSControl.ActiveInScene();

            if (enableFPS && currentTower.disableFPS)
            {
                enableFPS = false;
            }
            if (enableFPS && FPSControl.UseTowerWeapon() && currentTower.FPSWeaponID == -1)
            {
                enableFPS = false;
            }
            if (enableFPS && !FPSControl.IsIDAvailable(currentTower.FPSWeaponID))
            {
                enableFPS = false;
            }
            butFPSObj.SetActive(enableFPS);
        }