public Vector3 PlayerSideMovement(Vector3 direction, PlayerController.PlayerState pState) { //if player jumping or holding plank slow them down if (playerController.playerState == PlayerController.PlayerState.jumping) { //and add small amount of input direction playerFinalDirection = (direction * playerSpeed) - ((direction * playerSpeed) * slowDownJumpSpeedPercentage); reversePlayerMovementFromJoysticks = ((direction * playerSpeed) - ((direction * playerSpeed) * slowDownJumpSpeedPercentage)) * -1; //TODO: figure out how to stop player from doing accelerated jump //clamp magnitude so players cannot accelerate past momentum //Mathf.Clamp(playerFinalDirection.magnitude, 0, playerMomentum.magnitude); } else if (playerController.playerActions.HeldPlank != null) { //and add small amount of input direction playerFinalDirection = (direction * playerSpeed) - ((direction * playerSpeed) * slowDownHoldingPlankSpeedPercentage); reversePlayerMovementFromJoysticks = ((direction * playerSpeed) - ((direction * playerSpeed) * slowDownHoldingPlankSpeedPercentage)) * -1; } else { reversePlayerMovementFromJoysticks = (direction * playerSpeed) * -1; playerFinalDirection = direction * playerSpeed; } return(playerFinalDirection); }
public virtual void onStateChanged(PlayerController.PlayerState currentState) { mState.mPlayback = currentState; if (currentState == PlayerController.PlayerState.PLAYING) { mPlayButton.ImageResource = R.drawable.ic_media_pause; mUpdateEventHandler.sendEmptyMessage(PositionUpdater.START_POLLING); } else { mPlayButton.ImageResource = R.drawable.ic_media_play; mUpdateEventHandler.sendEmptyMessage(PositionUpdater.STOP_POLLING); } if (currentState == PlayerController.PlayerState.BUFFERING || currentState == PlayerController.PlayerState.INITIALIZING) { mProgressDialog.show(); } else { mProgressDialog.dismiss(); //mAdjustingSeekPosition = false; } if (currentState == PlayerController.PlayerState.STOPPED) { onCurrentPositionUpdated(0); } }
public void ShowWindow(string message, string levelChange) { textMesh.text = message.ToUpper(); ToggleSelfAndChildren(true); LevelChange = levelChange; lastState = PlayerController.Current.CurrentState; PlayerController.Current.CurrentState = PlayerController.PlayerState.Paused; }
//public void MuteAll() //{ // BoyMusic.volume = 0; // GirlMusic.volume = 0; //} public void SwitchGenderSounds(PlayerController.PlayerState gender) { if (gender == PlayerController.PlayerState.Boy) { StartCoroutine(FadeVolume(GirlMusic, BoyMusic, 1.4f)); } if (gender == PlayerController.PlayerState.Girl) { StartCoroutine(FadeVolume(BoyMusic, GirlMusic, 1.4f)); } }
/// <summary> /// Constructs <seealso cref="VideoPlayerState"/> from bundle. /// </summary> /// <param name="savedState"> the bundle containing the saved mState </param> internal VideoPlayerState(Bundle savedState) { mMediaUri = Uri.parse(savedState.getString(MEDIA_URI)); mSubtitlesUri = Uri.parse(savedState.getString(SUBTITLES_URI)); mTitle = savedState.getString(TITLE); mMimeType = savedState.getString(MIME_TYPE); mPlayback = Enum.Parse(typeof(PlayerController.PlayerState), savedState.getString(PLAYER_STATE)); mPosition = savedState.getInt(POSITION); mDuration = savedState.getInt(DURATION); mMute = savedState.getInt(MUTE) == 1; mDeviceId = savedState.getString(DEVICE_ID); }
/// <summary> /// Constructs <seealso cref="MusicPlayerState"/> from bundle. /// </summary> /// <param name="savedState"> the bundle containing the saved mState </param> internal MusicPlayerState(Bundle savedState) { mMediaUri = Uri.parse(savedState.getString(MEDIA_URI)); mAlbumArtUri = Uri.parse(savedState.getString(COVER_URI)); mTitle = savedState.getString(TITLE); mArtist = savedState.getString(ARTIST); mMimeType = savedState.getString(MIMETYPE); mPlayback = Enum.Parse(typeof(PlayerController.PlayerState), savedState.getString(PLAYER_STATE)); mPosition = savedState.getInt(POSITION); mDuration = savedState.getInt(DURATION); mMute = savedState.getInt(MUTE) == 1; mDeviceId = savedState.getString(DEVICE_ID); }
public void SetState(PlayerController.PlayerState s) { if (State != null && State.State == s) { return; } if (!States.ContainsKey(s)) { Debug.Log("ATTEMPTED TO USE INVALID STATE: " + s); return; } if (State != null) { State.OnEnd(this); } State = States[s]; State.OnStart(this); }
public PState(PlayerController.PlayerState s, string t) { State = s; TriggerName = t; }
public PState(PlayerController.PlayerState s) { State = s; TriggerName = ""; }
/// <summary> /// Constructs <seealso cref="VideoPlayerState"/> from bundle. /// </summary> /// <param name="savedState"> the bundle containing the saved mState </param> internal VideoPlayerState(Bundle savedState) { mMediaUri = Uri.parse(savedState.getString(MEDIA_URI)); mSubtitlesUri = Uri.parse(savedState.getString(SUBTITLES_URI)); mTitle = savedState.getString(TITLE); mMimeType = savedState.getString(MIME_TYPE); mPlayback = Enum.Parse(typeof(PlayerController.PlayerState), savedState.getString(PLAYER_STATE)); mPosition = savedState.getInt(POSITION); mDuration = savedState.getInt(DURATION); mMute = savedState.getInt(MUTE) == 1; mDeviceId = savedState.getString(DEVICE_ID); }
/// <summary> /// Constructs <seealso cref="MusicPlayerState"/> from bundle. /// </summary> /// <param name="savedState"> the bundle containing the saved mState </param> internal MusicPlayerState(Bundle savedState) { mMediaUri = Uri.parse(savedState.getString(MEDIA_URI)); mAlbumArtUri = Uri.parse(savedState.getString(COVER_URI)); mTitle = savedState.getString(TITLE); mArtist = savedState.getString(ARTIST); mMimeType = savedState.getString(MIMETYPE); mPlayback = Enum.Parse(typeof(PlayerController.PlayerState), savedState.getString(PLAYER_STATE)); mPosition = savedState.getInt(POSITION); mDuration = savedState.getInt(DURATION); mMute = savedState.getInt(MUTE) == 1; mDeviceId = savedState.getString(DEVICE_ID); }
void OnPlayerStateChange(PlayerController.PlayerState state) { canTurn = PlayerController.Instance.PlayerCanControl; }