private void Update() { #if DEBUG_CLEAR if (Input.GetKeyDown(KeyCode.C)) { StageManager.StartClear(); } #endif #if DEBUG_GUI if (Input.GetKeyDown(KeyCode.P)) { isDebugDisp = !isDebugDisp; } #endif }
/// <summary> /// クリアチェック。これ以降の処理が不要な場合、trueを返します。 /// </summary> /// <returns>以降の当たり判定が不要な時、true</returns> bool ClearCheck(Collider other) { if (!StageManager.CanMove || StageManager.IsClearPlaying) { return(true); } // クリアチェック if (other.CompareTag("Finish")) { StageManager.StartClear(); return(true); } return(false); }
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; } }
private new void Awake() { instance = this; IsClearPlaying = false; base.Awake(); }