diff --git a/jyx2/Assets/BuildSource/RELEASE_NOTE.txt b/jyx2/Assets/BuildSource/RELEASE_NOTE.txt index bb83a4816b..3ed995f8cb 100644 --- a/jyx2/Assets/BuildSource/RELEASE_NOTE.txt +++ b/jyx2/Assets/BuildSource/RELEASE_NOTE.txt @@ -1,4 +1,5 @@ 2022-05-09 +优化:黑龙潭移动方式改为点击无寻路和摇杆两种 优化:移动端移动操作模式默认改为虚拟摇杆 2022-05-04 diff --git a/jyx2/Assets/Scripts/LevelMaster.cs b/jyx2/Assets/Scripts/LevelMaster.cs index 86000d62fc..18ea680562 100644 --- a/jyx2/Assets/Scripts/LevelMaster.cs +++ b/jyx2/Assets/Scripts/LevelMaster.cs @@ -524,8 +524,6 @@ public void PlayerWarkFromTo(Vector3 fromVector, Vector3 toVector, Action callba void OnClickControlPlayer() { - if (_currentMap.IsNoNavAgent()) return; - SetPlayerSpeed(_playerNavAgent.velocity.magnitude); @@ -564,9 +562,21 @@ void OnClickControlPlayer() //BY CG: MASK:15:Ground层 else if (Physics.Raycast(ray, out hitInfo, 500, 1 << LayerMask.NameToLayer("Ground"))) { - _playerNavAgent.isStopped = false; - _playerNavAgent.updateRotation = true; - _playerNavAgent.SetDestination(hitInfo.point); + if (_currentMap.IsNoNavAgent()) + { + var dest = hitInfo.point; + if (Vector3.Distance(_gameMapPlayer.transform.position, dest) < 0.1f) return; + var speed = GlobalAssetConfig.Instance.playerMoveSpeed; + _gameMapPlayer.transform.LookAt(new Vector3(dest.x, _gameMapPlayer.transform.position.y, dest.z)); + _gameMapPlayer.transform.Translate(_gameMapPlayer.transform.forward * speed * Time.deltaTime, Space.World); + SetPlayerSpeed(speed); + } + else + { + _playerNavAgent.isStopped = false; + _playerNavAgent.updateRotation = true; + _playerNavAgent.SetDestination(hitInfo.point); + } DisplayNavPointer(hitInfo.point); }