| | |
| | | // River Add for Mouse Start Drag & Draged. |
| | | controller.startedDrag += OnStartDrag; |
| | | controller.dragged += this.OnDrag; |
| | | controller.pressed += OnPressed; |
| | | controller.released += this.OnEndDrag; |
| | | } |
| | | } |
| | |
| | | |
| | | controller.startedDrag -= this.OnStartDrag; |
| | | controller.dragged -= this.OnDrag; |
| | | controller.pressed -= OnPressed; |
| | | controller.released -= this.OnEndDrag; |
| | | } |
| | | |
| | |
| | | if (UnityInput.GetKeyDown(key)) |
| | | { |
| | | Tower controller = EndlessLevelManager.instance.TowerLibrary[key - KeyCode.Alpha1]; |
| | | if (EndlessLevelManager.instance.Currency.CanAfford(controller.purchaseCost)) |
| | | if (m_GameUI.isBuilding) |
| | | { |
| | | if (m_GameUI.isBuilding) |
| | | { |
| | | m_GameUI.CancelGhostPlacement(); |
| | | } |
| | | EndlessGameUI.instance.SetToBuildMode(controller); |
| | | EndlessGameUI.instance.TryMoveGhost(InputController.instance.basicMouseInfo); |
| | | m_GameUI.CancelGhostPlacement(); |
| | | } |
| | | EndlessGameUI.instance.SetToBuildMode(controller); |
| | | EndlessGameUI.instance.TryMoveGhost(InputController.instance.basicMouseInfo); |
| | | break; |
| | | } |
| | | } |
| | |
| | | Debug.Log("新手不可以拖拽"); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | GuideCtrl.Ins.BeginDrag11_1(); |
| | | } |
| | | |
| | | } |
| | | // select towers |
| | | m_GameUI.TrySelectTower(pointer); |
| | |
| | | //新手引导这里会把引导的速度变慢 |
| | | currentTimeScale = Time.timeScale; |
| | | Time.timeScale = 0.5f; |
| | | } |
| | | else |
| | | { |
| | | GuideCtrl.Ins.BeginDrag5_1(); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private void OnPressed(PointerActionInfo pointer) |
| | | { |
| | | m_GameUI.OnPressed(pointer); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Select towers or position ghosts |
| | | /// </summary> |