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(); } }
void OnTouchCursorDown(Vector3 cursorPos) { UnitTower tower = GameControl.Select(cursorPos); if (tower != null) { SelectTower(tower); UIBuildButton.Hide(); } else { if (selectedTower != null) { ClearSelectedTower(); return; } if (!UseDragNDrop()) { if (BuildManager.CheckBuildPoint(cursorPos) == _TileStatus.Available) { UIBuildButton.Show(); } else { UIBuildButton.Hide(); } } } }
void OnCursorDown(Vector3 cursorPos) { UnitTower tower = GameControl.Select(cursorPos); GameControl.SelectTower(tower); if (tower != null) { if (!BuildManager.UseDragNDrop()) { UIBuildButton.Hide(); } if (autoCenterCamera) { CameraControl.SetPosition(tower.thisT.position); } UITowerView.Show(tower); } else { UITowerView.Hide(); if (!BuildManager.UseDragNDrop()) { BuildInfo buildInfo = BuildManager.CheckBuildPoint(cursorPos); UIBuildButton.Show(buildInfo); if (buildInfo.status == _TileStatus.Available && autoCenterCamera) { CameraControl.SetPosition(buildInfo.position); } } } }
void OnFPSMode(bool flag) { //FPSModeCrosshairObj.SetActive(flag); #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY UIGameMessage.DisplayMessage("FPS mode is not supported in mobile"); #endif if (flag) { UIBuildButton.Hide(); UIAbilityButton.Hide(); UIPerkMenu.Hide(); UIFPSHUD.Show(); } else { if (UseDragNDrop()) { UIBuildButton.Show(); } if (AbilityManager.IsOn()) { UIAbilityButton.Show(); } if (PerkManager.IsOn()) { UIPerkMenu.Show(); } UIFPSHUD.Hide(); } }
IEnumerator _OnGameOver(int _star) { UIBuildButton.Hide(); yield return(new WaitForSeconds(1.0f)); UIGameOverMenu.Show(_star); }
IEnumerator _OnGameOver(bool playerWon) { UIBuildButton.Hide(); yield return(new WaitForSeconds(1.0f)); UIGameOverMenu.Show(playerWon); }
public static void OnFPSMode(bool flag) { if (flag) { UIBuildButton.Hide(); UIAbilityButton.Hide(); UIFPS.Show(); } else { UIBuildButton.Show(); UIAbilityButton.Show(); UIFPS.Hide(); } }
// Update is called once per frame void Update() { if (GameControl.GetGameState() == _GameState.Over) { return; } if (UIUtilities.IsCursorOnUI()) { return; } if (!UseDragNDrop() && !UIBuildButton.isOn) { BuildManager.SetIndicator(Input.mousePosition); } if (Input.GetMouseButtonDown(0)) { UnitTower tower = GameControl.Select(Input.mousePosition); if (tower != null) { SelectTower(tower); UIBuildButton.Hide(); } else { if (selectedTower != null) { ClearSelectedTower(); return; } if (!UseDragNDrop()) { if (BuildManager.CheckBuildPoint(Input.mousePosition) == _TileStatus.Available) { UIBuildButton.Show(); } else { UIBuildButton.Hide(); } } } } }