void HandlePounceInput() { // None of this is relevant on remote clients if (!HasAuthority()) { return; } if (input.isJustPressed(PlayerInput.Key.action1)) { // Action key just pressed PounceIndicator.Show(); photonView.RPC("RpcSetRemoteIsChargingPounce", RpcTarget.All, true); } if (input.isDown(PlayerInput.Key.action1)) { // Action key is down, so charge leap timeSpentCharging += Time.deltaTime; PounceIndicator.SetPercentage(PounceChargePercentage()); } else if (input.isJustReleased(PlayerInput.Key.action1)) { if (CanPounce()) { // Pounce physicsEntity.AddVelocity(CalculatePounceVelocity()); attachedDirection = Utility.Directions.Null; pounceAudioSource.Play(); pounceSecondarySoundSet.PlayRandom(); } ResetPounceCharge(); PounceIndicator.Hide(); photonView.RPC("RpcSetRemoteIsChargingPounce", RpcTarget.All, false); } }
void HandlePounceChargeInput() { float pounceAngle; pounceAngle = Utility.GetAngleToMouse(transform.position); PounceIndicator.SetAngle(pounceAngle); }