Exemplo n.º 1
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();
            }
        }
Exemplo n.º 2
0
 public static bool DnDHasValidPos()
 {
     return(sInfo != null && sInfo.HasValidPoint() && sInfo.CanBuildTower(instance.dndTower.prefabID));
 }