/// <summary> /// ヒップドロップ。空中でvelocity0に。一瞬待って真下に等速運動 /// </summary> private void HipDrop() { this.StopAllCoroutineOfRotation(); //現在はbackFlipのコルーチンのみ //this.IsStickingWall = false; this.IsHipDropping = true; this._velocity = Vector3.zero; this.transform.rotation = new Quaternion(0f, this.transform.rotation.y, 0f, this.transform.rotation.w); this.currentState = E_State.HipDropping; this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.HipDrop); SEManager.Instance.Stop(SEPath.STICKING_WALL); SEManager.Instance.Play(SEPath.JUMP_VOICE8, volumeRate: 0.5f); SEManager.Instance.Play(SEPath.HIP_DROP_ROTATE); //CapsuleCollider _collider = GetComponent<CapsuleCollider>(); this._hitHeadCheck.localPosition = Vector3.zero; this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero); this._groundCheck.localPosition = Vector3.zero; this._groundCheck.localRotation = Quaternion.Euler(Vector3.zero); if (this.CountGroundNearFoots == 0) //地面スレスレでないとき { StartCoroutine(TransformManager.RotateInCertainTimeByAxisFromAway(this.transform, this.CenterPosition, E_TransformAxis.Right, 360f, 0.14f)); StartCoroutine(TransformManager.RotateInCertainTimeByAxisFromAway(this._hitHeadCheck, this.CenterPosition, E_TransformAxis.Right, -360f, 0.14f)); StartCoroutine(TransformManager.RotateInCertainTimeByAxisFromAway(this._groundCheck, this.CenterPosition, E_TransformAxis.Right, -360f, 0.14f)); StartCoroutine(CoroutineManager.DelayMethod(0.15f, () => { this._hitHeadCheck.localPosition = Vector3.zero; this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero); this._groundCheck.localPosition = Vector3.zero; this._groundCheck.localRotation = Quaternion.Euler(Vector3.zero); })); } StartCoroutine(CoroutineManager.DelayMethod(0.3f, () => { this._velocity.y = -1 * this.hipDropVerticalSpeed; })); }
public void GameClear() { SEManager.Instance.Play(SEPath.SUCCESS, 0.5f); this.isClear = true; StageTimeManager.Instance.CountTimeStop = true; StageTimeManager.Instance.SetActiveCountTime(false); StageCameraManager.Instance.SetAbleFollow(false); StartCoroutine(this.SetAndShowRankingWhenClear()); StartCoroutine(CoroutineManager.DelayMethod(5f, () => SavePlayerResult())); }
/// <summary> /// ステージを選択したときの遷移処理 /// </summary> /// <param name="selectStageIndex">選択したステージのindex</param> public void SelectStage(int selectStageIndex) { if (selectStageIndex == 9 && !StaticData.isOpenStage10) { this.stage10KeyInputField.Select(); } else { foreach (Button b in this.selectStageViewButtons) { b.enabled = false; } BGMManager.Instance.Play(BGMPath.STAGE_BGM1, volumeRate: 0.5f); StartCoroutine(CoroutineManager.DelayMethod(0.5f, () => SceneManager.LoadScene("Stage" + (selectStageIndex + 1).ToString()))); } }
private void Update() { if (!StageTimeManager.Instance.IsPlayerMoving) { return; } if (this.playerMoveController.IsGrounded && this._collider.enabled) { this._collider.enabled = false; this.stickWallCount = 0; this.normalVector = Vector3.zero; } if (!this.playerMoveController.IsGrounded && !this._collider.enabled) { StartCoroutine(CoroutineManager.DelayMethod(10, () => this._collider.enabled = true)); } CheckInputToWall(); }
/// <summary> /// バク転 /// </summary> private void BackFlip() { //this._velocity.y = this.backFlipVerticalSpeed; this._isGrounded = false; //進行方向を向く if (!(this._velocity.x == 0f && this._velocity.z == 0f)) { this.transform.forward = new Vector3(this._velocity.x, 0f, this._velocity.z); } this._velocity = this.transform.forward * -1 * this.backFlipHorizontalSpeed + this.transform.up * this.backFlipVerticalSpeed; this._hitHeadCheck.localPosition = Vector3.zero; this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero); this._groundCheck.localPosition = Vector3.zero; this._groundCheck.localRotation = Quaternion.Euler(Vector3.zero); StartCoroutine(TransformManager.RotateInCertainTimeByFixedAxisFromAway(this.transform, this.CenterPosition, E_TransformAxis.Right, -1080f, 1f)); StartCoroutine(TransformManager.RotateInCertainTimeByFixedAxisFromAway(this._hitHeadCheck, this.CenterPosition, E_TransformAxis.Right, 1080f, 1f)); StartCoroutine(TransformManager.RotateInCertainTimeByFixedAxisFromAway(this._groundCheck, this.CenterPosition, E_TransformAxis.Right, 1080f, 1f)); StartCoroutine(CoroutineManager.DelayMethod(1.1f, () => { this._hitHeadCheck.localPosition = Vector3.zero; this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero); this._groundCheck.localPosition = Vector3.zero; this._groundCheck.localRotation = Quaternion.Euler(Vector3.zero); })); //this.canStickWall = false; //StartCoroutine(CoroutineManager.DelayMethod(0.3f, () => this.canStickWall = true)); this.currentState = E_State.BackFliping; this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.BackFlip); SEManager.Instance.Play(SEPath.JUMP_VOICE1); SEManager.Instance.Play(SEPath.JUMP_WIND0); StartCoroutine(CoroutineManager.DelayMethod(0.4f, () => SEManager.Instance.Play(SEPath.JUMP_WIND0, volumeRate: 0.8f))); StartCoroutine(CoroutineManager.DelayMethod(0.8f, () => SEManager.Instance.Play(SEPath.JUMP_WIND0, volumeRate: 0.8f))); }
/// <summary> /// タイトル画面にもどる /// </summary> public void GoTitle() { StartCoroutine(CoroutineManager.DelayMethod(0.1f, () => SceneManager.LoadScene("Title"))); }
/// <summary> /// チュートリアルを開始する /// </summary> public void GoTutorial() { StartCoroutine(CoroutineManager.DelayMethod(0.1f, () => SceneManager.LoadScene("Tutorial"))); }
/// <summary> /// プレイヤーの移動速度に応じて状態を変える(ジャンプなどの入力は別) /// </summary> private void UpdateState() { //ここで接地判定をおこなうため、jumpなどの処理時に念のため_isGrounded = falseにするべき if (this._isGrounded) { this.CountGroundNearFoots = 0; if (this.currentState == E_State.BackFliping) { this.StopAllCoroutineOfRotation(); } if (this.currentState == E_State.HipDropping) { this.countFrameOfGroundFromHipDrop = 1; this.AbleBreakByHipDrop = true; SEManager.Instance.Play(SEPath.HIP_DROP_GROUNDED, volumeRate: 0.25f); SEManager.Instance.Play(SEPath.HIP_DROP_GROUNDED1, volumeRate: 0.25f); Instantiate(this.hipDropOnGroundShock, this.transform.position, Quaternion.identity); } else if (this.currentState != E_State.Standing && this.currentState != E_State.Running) { SEManager.Instance.Play(SEPath.ON_GROUNDED_SOUND, volumeRate: 0.4f); } if (this.currentState == E_State.StickingWall) { SEManager.Instance.Stop(SEPath.STICKING_WALL); } if (this.inputVelocity == Vector2.zero) { SEManager.Instance.Stop(SEPath.RUNNING_SOUND); this.currentState = E_State.Standing; } else { if (!SEManager.Instance.GetCurrentAudioNames().Any(s => s == "RunningSound")) { SEManager.Instance.Play(SEPath.RUNNING_SOUND, volumeRate: 0.2f); } this.currentState = E_State.Running; } } else { SEManager.Instance.Stop(SEPath.RUNNING_SOUND); if (this.currentState == E_State.HipDropping) { return; //ヒップドロップ中は着地するまで遷移しない } if (this.currentState == E_State.JumpToTop && this._velocity.y > 0f) { this.currentState = E_State.TopOfJump; } else if (this._velocity.y <= -0f && (this.currentState != E_State.SpinJumping && this.currentState != E_State.StickingWall && this.currentState != E_State.BackFliping)) { this.currentState = E_State.Falling; } } if (!this.setStickWallTrigger && this.IsStickingWall && this.currentState != E_State.StickingWall) { if (this.IsGrounded) { this.IsStickingWall = false; } else { this.setStickWallTrigger = true; if (Time.deltaTime < 0.05f) { StartCoroutine(CoroutineManager.DelayMethod(0.05f, () => { this.IsStickingWall = false; this.setStickWallTrigger = false; })); } else { StartCoroutine(CoroutineManager.DelayMethod(0.08f, () => { this.IsStickingWall = false; this.setStickWallTrigger = false; })); } } } if (0 < this.countFrameOfGroundFromHipDrop && this.countFrameOfGroundFromHipDrop < 4) { this.countFrameOfGroundFromHipDrop++; } if (this.countFrameOfGroundFromHipDrop == 4) { this.countFrameOfGroundFromHipDrop = 0; this.IsHipDropping = false; } }
public void StopAllMove(int stopFrame) { StageTimeManager.Instance.PlayerStop = true; StartCoroutine(CoroutineManager.DelayMethod(stopFrame, () => StageTimeManager.Instance.PlayerStop = false)); }
public void ResetTrigger() { this.stickWallCount = 0; this._collider.enabled = false; StartCoroutine(CoroutineManager.DelayMethod(8, () => this._collider.enabled = true)); }
private void Start() { StartCoroutine(CoroutineManager.DelayMethod(1, () => this.inputPlayerNameField.Select())); }