private void HandlePlayerJump(object sender, PlayerJumpEventArgs e) { if (e.Player == null) { return; } PlayerJumpEvent newEvent = new PlayerJumpEvent() { JumperSteamID = e.Player.SteamID }; CurrentTick.Events.Add(newEvent); }
void OnJump() { PlayerModel player = playerController.player; if (null == player.getActiveShip()) { throw new UnityException("Player must have a ship to jump"); } if (player.getActiveShip().currentHullAmount > 0) { PlayerJumpEvent playerJumpEvent = new PlayerJumpEvent(player); application.eventManager.DispatchEvent <PlayerJumpEvent>(playerJumpEvent); } else { throw new UnityException("Player ship must be repaired"); } }
void JumpMe(PlayerJumpEvent e) { if (_isGrounded) { _verticalSpeed = Jump; Event <PlaySoundEvent> .Broadcast(new PlaySoundEvent(JumpSound)); Event <PlayerHaveJumped> .Broadcast(new PlayerHaveJumped()); } else if (G.Sys.powerupManager.IsEnabled(PowerupType.DOUBLE_JUMP) && !_haveDoubleJumped) { _verticalSpeed = Jump; Event <PlaySoundEvent> .Broadcast(new PlaySoundEvent(JumpSound)); Event <PlayerHaveJumped> .Broadcast(new PlayerHaveJumped()); _haveDoubleJumped = true; } else { _currentJumpBuffer = JumpBuffer; } }
void OnPlayerJump(PlayerJumpEvent e) { ChangeState(GameState.WorldMap); }