修改点击逻辑

This commit is contained in:
YangHua 2023-11-21 18:02:07 +08:00
parent 8f97498f16
commit 6ad2acd75a
2 changed files with 16 additions and 12 deletions

View File

@ -102,6 +102,22 @@ public class GameManager : MonoBehaviour
}
private void Update()
{
if (Input.GetMouseButtonDown(1))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hitInfo;
if (Physics.Raycast(ray, out hitInfo, 1000))
{
if (hitInfo.collider.tag == "WRJ")
{
UnmannedAerialVehicleUI.Instance.unmannedAerialVehicleManage = hitInfo.collider.GetComponent<UnmannedAerialVehicleManage>();
}
}
}
}
public void OnOtherPlayerOnline(string msg)
{
StopCoroutine(WaitSpawn(msg));

View File

@ -143,18 +143,6 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(1))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hitInfo;
if (Physics.Raycast(ray, out hitInfo, 1000))
{
if (hitInfo.collider.tag == "WRJ")
{
UnmannedAerialVehicleUI.Instance.unmannedAerialVehicleManage = transform.GetComponent<UnmannedAerialVehicleManage>();
}
}
}
if (isStartRehearsing && isStartRehearsing && pattern == Pattern.)
{
if (airRoute)