void Miss(Collider2D col) { if (mutekiTime >= 0) { return; } // 無敵時間設定 mutekiTime = mutekiSeconds; SoundController.Play(SoundController.SeType.Miss); // 吹っ飛び処理 Vector3 hitpos = col.ClosestPoint(transform.position); Vector3 addVec = transform.position - hitpos; Vector3 add = addVec.normalized * blowOffAdd; rb.velocity = Vector2.zero; rb.AddForce(add, ForceMode2D.Impulse); // 吸い寄せ中のアイテムがあったら解除 for (int i = 0; i < eatingCount; i++) { eatingObjects[i].ReleaseEat(); } eatingCount = 0; anim.SetBool("Inhale", false); isEating = false; // ゲームオーバーチェック if (GameParams.LifeDecrement()) { anim.SetInteger("State", (int)AnimType.Dead); gameObject.layer = gameOverLayer; rb.gravityScale = gameOverGravityScale; GameManager.GameOver(); return; } }
/// <summary> /// 口を閉じる /// </summary> public void CloseMouth() { SoundController.Play(SoundController.SeType.Eat); anim.SetBool("Inhale", false); }
/// <summary> /// クレジットの表示を設定 /// </summary> /// <param name="flag"></param> public void DisplayCredit(bool flag) { SoundController.Play(SoundController.SeType.Click); creditObject.SetActive(flag); }