コード例 #1
0
ファイル: Mnifier.cs プロジェクト: joshdixon/DemoMinifier
        private void HandlePlayerJump(object sender, PlayerJumpEventArgs e)
        {
            if (e.Player == null)
            {
                return;
            }

            PlayerJumpEvent newEvent = new PlayerJumpEvent()
            {
                JumperSteamID = e.Player.SteamID
            };

            CurrentTick.Events.Add(newEvent);
        }
コード例 #2
0
        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");
            }
        }
コード例 #3
0
    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;
        }
    }
コード例 #4
0
 void OnPlayerJump(PlayerJumpEvent e)
 {
     ChangeState(GameState.WorldMap);
 }