public override void UpdateAction() { // つた掴みチェック if (StellaMove.CheckIvyHold()) { return; } // 行動ボタンチェック。着地時は何もしない if (Input.GetButton("Action") && !isLanding) { Actable act = StellaMove.ActionBoxInstance.GetActableInstance(); if (act != null) { if (act.Action()) { return; } } } StellaMove.instance.Gravity(); StellaMove.instance.Move(); // 着地チェック bool isGrounded = StellaMove.ChrController.isGrounded; if (!isGrounded && (StellaMove.myVelocity.y < 0)) { int hitCount = PhysicsCaster.CharacterControllerCast( StellaMove.ChrController, Vector3.down, StellaMove.CollisionMargin, PhysicsCaster.MapCollisionPlayerOnlyLayer); for (int i = 0; i < hitCount; i++) { if (!PhysicsCaster.hits[i].collider.isTrigger) { isGrounded = true; } } } // 着地チェック if (!isLanding && isGrounded && StellaMove.myVelocity.y < 0f) { SoundController.Play(SoundController.SeType.Landing); StellaMove.myVelocity.x = 0; StellaMove.RegisterAnimEvent(Grounded); isLanding = true; StellaMove.CheckStepOn(); StageManager.SetFollowCameraTarget(StellaMove.instance.transform); } // 頭ぶつけチェック else if ((StellaMove.myVelocity.y > 0f) && StellaMove.IsHitHead) { SoundController.Play(SoundController.SeType.HitHead); StellaMove.myVelocity.y = 0f; } }
public override void OnFadeOutDone() { SoundController.PlayBGM(SoundController.BgmType.Title, true); SceneManager.SetActiveScene(gameObject.scene); }
private void Update() { if (Fade.IsFading || SceneChanger.NextScene != SceneChanger.SceneType.None || SceneChanger.NowScene != SceneChanger.SceneType.Title) { return; } switch (state) { case StateType.Opening: if (videoPlayer.time <= 0) { break; } if (movieVolumeState == MovieVolumeState.WaitStart) { movieVolumeState++; movieWrapImage.SetActive(false); Invoke("StartNarration", waitNarration); startTime = Time.time; } canvasAnimator.SetBool("Show", true); if (!videoPlayer.isPlaying) { state = StateType.FadeOut; StartCoroutine(MovieFadeOut(waitMovie)); } else if (GameParams.IsActionAndWaterButtonDown || Input.GetKeyDown(KeyCode.Escape)) { SoundController.Play(SoundController.SeType.MoveCursor); state = StateType.FadeOut; StartCoroutine(MovieFadeOut(0)); } else { // timing switch (movieVolumeState) { case MovieVolumeState.Narration: if ((Time.time - startTime) >= movieVolumeUpTime) { movieVolumeState++; startTime = Time.time; } break; case MovieVolumeState.FadeIn: float t = Mathf.Clamp01((Time.time - startTime) / movieVolumeUpDuration); videoPlayer.SetDirectAudioVolume(0, Mathf.Lerp(movieVolume1, movieVolume2, t)); if (t >= 1f) { movieVolumeState++; } break; case MovieVolumeState.Last: break; } } break; case StateType.FadeOut: break; case StateType.Title: updateTitle(); break; case StateType.Credit: if (Input.GetKeyDown(KeyCode.Escape)) { ShowCredit(false); } break; } }
public void Rock() { MessageManager.instance.SetMessage(Messages.MessageType.Stage4Rock); SoundController.Play(SoundController.SeType.GimmickRock); }
/// <summary> /// クリア処理を開始 /// </summary> public static void StartClear() { IsClearPlaying = true; instance.StartCoroutine(instance.ClearSequence()); SoundController.PlayBGM(SoundController.BgmType.Clear); }
/// <summary> /// オープニングムービーを開始します。 /// </summary> void StartMovie() { SoundController.StopBGM(); videoPlayer.Play(); state = StateType.Opening; }
void PutDownNae() { SoundController.Play(SoundController.SeType.PutDown); StellaMove.RegisterAnimEvent(BackOff); StellaMove.naeActable.PutDown(); }
public void Tsuta() { SoundController.Play(SoundController.SeType.Tsuta0); }
public void FootStamp() { SoundController.Play(SoundController.SeType.Walk0 + Random.Range(0, WalkSeCount)); }
void HoldNae() { SoundController.Play(SoundController.SeType.LiftUp); StellaMove.RegisterAnimEvent(ToHold); StellaMove.naeActable.Hold(); }
public void PlaySe() { SoundController.Play(se); }
public override void UpdateAction() { if (state == StateType.Action) { StellaMove.ZyouroEmitter.transform.position = StellaMove.ZyouroEmitterPosition.position; // 水オブジェクトを生成 if (Time.time - lastTriggerTime >= triggerEmitSeconds) { lastTriggerTime = Time.time; triggerObjects[triggerIndex].SetActive(true); triggerObjects[triggerIndex].transform.position = StellaMove.ZyouroEmitterPosition.position; triggerRigidbody[triggerIndex].velocity = StellaMove.ZyouroEmitter.forward * triggerSpeed; triggerWater[triggerIndex].Start(); triggerIndex = (triggerIndex + 1) % triggerCount; } // 水まき終了チェック if (!Input.GetButton("Water") && (Grow.WaitGrowCount <= 0)) { // 水まき終了 state = StateType.End; StellaMove.SetAnimState(StellaMove.AnimType.Walk); StellaMove.RegisterAnimEvent(EndAction); zyouroParticle.Stop(); return; } // 効果音 if ((Time.time - lastSeTime) >= waterSeSeconds) { lastSeTime = Time.time; SoundController.Play(SoundController.SeType.Water); } // 後ずさりチェック float ofsy = StellaMove.chrController.height * 0.49f - StellaMove.chrController.radius; int hitCount = Physics.CapsuleCastNonAlloc( StellaMove.chrController.bounds.center + Vector3.up * ofsy, StellaMove.chrController.bounds.center + Vector3.down * ofsy, StellaMove.chrController.radius, Vector3.down, hits, 0, groundLayer); for (int i = 0; i < hitCount; i++) { // 下げる float colx = hits[i].collider.bounds.extents.x; float dist = StellaMove.chrController.radius + colx + StellaMove.CollisionMargin; float target = hits[i].transform.position.x - dist * StellaMove.forwardVector.x; float move = target - StellaMove.instance.transform.position.x; if (move * StellaMove.forwardVector.x >= 0f) { // 向いている方向には動かさない return; } StellaMove.myVelocity.x = move / Time.fixedDeltaTime; Vector3 lastPos = StellaMove.instance.transform.position; StellaMove.instance.Move(); lastPos.x = StellaMove.instance.transform.position.x; StellaMove.instance.transform.position = lastPos; StellaMove.myVelocity.x = 0f; } } else { StellaMove.instance.Gravity(); StellaMove.instance.Move(); } }