예제 #1
0
    private void Update()
    {
        bool isMeleeInvoked = dungeonPlayerMelee ? dungeonPlayerMelee.GetIsInvoking() : false;

        if (Input.GetMouseButton(1) && !isMeleeInvoked)
        {
            this.SetIsInvoking(true);
            OnPlayerAim?.Invoke();
            meleeWeapon.SetActive(false);
            rangedWeapon.SetActive(true);
        }
        else
        {
            this.SetIsInvoking(false);
            OnPlayerStop?.Invoke();
            meleeWeapon.SetActive(true);
            rangedWeapon.SetActive(false);
        }
    }
예제 #2
0
        private void PlayerStateChange(int NewState, string CurrentSong, Players ThePlayer)
        {
            try
            {
                switch (NewState)
                {
                case 0:        // Undefined
                    OnPlayerError.Invoke(new PlayerErrorEventArgs(ThePlayer, 0));
                    break;

                case 1:        // Stopped
                    if (!Crossfade && !InFade)
                    {
                        OnPlayerStop.Invoke(new PlayerStopEventArgs(CurrentSong, ThePlayer));
                    }
                    break;

                case 2:        // Paused
                    OnPlayerPaused.Invoke(new PlayerPausedEventArgs(CurrentSong, ThePlayer));
                    break;

                case 3:        // Playing
                    OnPlayerStart.Invoke(new PlayerStartEventArgs(CurrentSong, ThePlayer));
                    break;

                case 4:        // ScanForward
                    break;

                case 5:        // ScanReverse
                    break;

                case 6:        // Buffering
                    switch (ThePlayer)
                    {
                    case Players.Player1:
                        Player1State = PlayerStates.Loading;
                        break;

                    case Players.Player2:
                        Player2State = PlayerStates.Loading;
                        break;
                    }
                    break;

                case 7:        // Waiting
                    break;

                case 8:        // MediaEnded
                    OnPlayerMediaEnd.Invoke(new PlayerMediaEndedEventArgs(CurrentSong));
                    break;

                case 9:        // Transitioning
                    break;

                case 10:       // Ready
                    OnPlayerReady.Invoke(new PlayerReadyEventArgs(ThePlayer));
                    break;

                case 11:       // Reconnecting
                    break;

                case 12:       // Last
                    break;

                default:
                    OnPlayerError.Invoke(new PlayerErrorEventArgs(ThePlayer, -1));
                    break;
                }
            }
            catch
            {
            }
        }