コード例 #1
0
        public void SetTower(UnitTower tgtTower)
        {
            tower = tgtTower;

            if (thisObj == null)
            {
                Init();
            }

            slider.value = tower.GetConstructionStatus();

            UpdateScreenPosition();
        }
コード例 #2
0
        void Update()
        {
            if (tower == null)
            {
                if (thisObj.activeInHierarchy)
                {
                    thisObj.SetActive(false);
                }
                return;
            }

            slider.value = tower.GetConstructionStatus();

            UpdateScreenPosition();

            if (!tower.InConstruction())
            {
                tower = null;
                thisObj.SetActive(false);
            }
        }