Пример #1
0
        public void ShowWindow(Tower tower)   // show modal win for selling current tower
        {
            if (_buildingModalWin != null)
            {
                return;
            }

            _buildingModalWin = Instantiate(_prefabBuildingModalWin, parentForUI);
            Vector3 viewPos = Camera.main.WorldToViewportPoint(tower.transform.position);

            viewPos.x = Mathf.Clamp(viewPos.x, 0.27f, 0.7f);
            viewPos.y = Mathf.Clamp(viewPos.y, 0.27f, 0.7f);
            _buildingModalWin.buttonsPanelRT.anchorMin = new Vector2(viewPos.x, viewPos.y);
            _buildingModalWin.buttonsPanelRT.anchorMax = new Vector2(viewPos.x, viewPos.y);
            _buildingModalWin.Setup(tower);
        }
Пример #2
0
        public void ShowWindow(List <TowersTypes> towerTypes, Slot slot)  // show modal win for building tower over slot
        {
            if (_buildingModalWin != null)
            {
                return;
            }

            _buildingModalWin = Instantiate(_prefabBuildingModalWin, parentForUI);
            Vector3 viewPos = Camera.main.WorldToViewportPoint(slot.transform.position);

            viewPos.x = Mathf.Clamp(viewPos.x, 0.27f, 0.7f);
            viewPos.y = Mathf.Clamp(viewPos.y, 0.27f, 1f);
            _buildingModalWin.buttonsPanelRT.anchorMin = new Vector2(viewPos.x, viewPos.y);
            _buildingModalWin.buttonsPanelRT.anchorMax = new Vector2(viewPos.x, viewPos.y);

            _buildingModalWin.Setup(towerTypes, slot);
        }