Esempio n. 1
0
 public static void Show(SelectInfo info, bool instant = false)
 {
     if (instance != null)
     {
         instance._Show(info, instant);
     }
 }
Esempio n. 2
0
        private void OnCursorDown()
        {
            SelectInfo sInfo = TowerManager.GetSelectInfo(Input.mousePosition);

            bool select = false;
            bool build  = false;

            if (sInfo.HasValidPoint())
            {
                if (sInfo.GetTower() != null)
                {
                    select = true;
                    SelectControl.SelectUnit(sInfo.GetTower());
                    UITowerSelect.Show(sInfo.GetTower());
                }
                else if (buildMode == _BuildMode.PointNBuild && sInfo.AvailableForBuild())
                {
                    build = true;
                    UIBuildButton.Show(sInfo);
                    SelectControl.SelectNode(sInfo.platform, sInfo.nodeID);
                }
            }

            if (buildMode == _BuildMode.PointNBuild && !build)
            {
                SelectControl.ClearNode();
                UIBuildButton.Hide();
            }
            if (!select)
            {
                SelectControl.ClearUnit();
                UITowerSelect.Hide();
            }
        }
Esempio n. 3
0
        public void _Show(SelectInfo info, bool instant = false)
        {
            showTime = Time.time;
            sInfo    = info;

            UpdateDisplay();

            base._Show();
            //base._Show(instant);
        }
Esempio n. 4
0
        public static void ShowSampleTower(int prefabID, SelectInfo sInfo)
        {
            int idx = -1;

            for (int i = 0; i < instance.sampleList.Count; i++)
            {
                if (instance.sampleList[i].prefabID == prefabID)
                {
                    idx = i; break;
                }
            }

            instance.sampleList[idx].GetT().rotation = sInfo.GetRot();
            instance.sampleList[idx].GetT().position = sInfo.GetPos();
            instance.sampleList[idx].GetObj().SetActive(true);
            instance.activeSampleTowerIdx = idx;

            SelectControl.SelectUnit(instance.sampleList[idx]);
        }