private float recordTime = 0f;
public void Update(float delta)
{
// -------------------------------------
recordTime += Time.deltaTime;
if (Input.GetMouseButton(0))
{
Vector3 mousePos = Input.mousePosition;
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
int id = Input.GetTouch(0).fingerId;
if (!EventSystem.current.IsPointerOverGameObject(id) )//移动平台
{
FishPlayerItems[MyClientSeat].gunFollow.UpdateGunRotation(mousePos);
if(recordTime >= FishPlayerItems[MyClientSeat].playerData.Launcher.Setting.interval)
{
HandleHitFish(m_MyClientSeat, mousePos);
recordTime = 0f;
}
}
#endif
#if UNITY_EDITOR
if (!EventSystem.current.IsPointerOverGameObject())
{
FishPlayerItems[MyClientSeat].gunFollow.UpdateGunRotation(mousePos);
if (recordTime >=MySelf.Launcher.Setting.interval)
{
HandleHitFish(m_MyClientSeat, mousePos);
recordTime = 0f;
}
public void Update(float delta)
{
// -------------------------------------
recordTime += Time.deltaTime;
if (Input.GetMouseButton(0))
{
Vector3 mousePos = Input.mousePosition;
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
int id = Input.GetTouch(0).fingerId;
if (!EventSystem.current.IsPointerOverGameObject(id) )//移动平台
{
FishPlayerItems[MyClientSeat].gunFollow.UpdateGunRotation(mousePos);
if(recordTime >= FishPlayerItems[MyClientSeat].playerData.Launcher.Setting.interval)
{
HandleHitFish(m_MyClientSeat, mousePos);
recordTime = 0f;
}
}
#endif
#if UNITY_EDITOR
if (!EventSystem.current.IsPointerOverGameObject())
{
FishPlayerItems[MyClientSeat].gunFollow.UpdateGunRotation(mousePos);
if (recordTime >=MySelf.Launcher.Setting.interval)
{
HandleHitFish(m_MyClientSeat, mousePos);
recordTime = 0f;
}
}
#endif}
}