void HandleTouch(TouchSide touchSide, TouchType touchType) { if (SignalTouch != null) { SignalTouch(touchSide, touchType); } }
public bool GetIsPressed(TouchSide touchSide) { if (touchSide == TouchSide.Left) { return(leftTouchZone.uiItem.IsPressed); } if (touchSide == TouchSide.Right) { return(rightTouchZone.uiItem.IsPressed); } Debug.LogWarning("invalid touch zone type"); return(false); }
void HandleTouch(TouchSide touchSide, TouchType touchType) { if (touchSide == TouchSide.Left) { if (touchType == TouchType.OnDown) { shooter.TurnOnShield(); } else if (touchType == TouchType.OnRelease) { shooter.TurnOffShield(); } } else if (touchSide == TouchSide.Right) { if (touchType == TouchType.OnDown) { if (!shooter.shield.isOn) { if (shooter.CanFire()) { if (shooter.gun.isAutomatic) { shooter.StartAutoFiring(); } else { shooter.Fire(true); } } else if (shooter.CanReload()) { shooter.StartReloading(); } } } else if (touchType == TouchType.OnRelease) { if (shooter.isAutoFiring) { shooter.StopAutoFiring(); } if (shooter.isReloading) { shooter.StopReloading(); } } } }