void holyWaterEffectUpdate() { holyWaterEffectTime -= Time.fixedDeltaTime; if (holyWaterEffectTime <= 1.533f && holyWaterEffectTime > 1f) { if (GhostAnim.GetComponent <Animator>().GetInteger("GhostControl") != 2) { GhostAnim.SetGhostAnimation(GhostAnimator.StandUp); //アニメーション設定 } } if (holyWaterEffectTime <= 0f) { GhostAnim.SetGhostAnimation(GhostAnimator.Walk); //アニメーション設定 ifHolyWaterAffect = false; SE.playSE(); } }
// Start is called before the first frame update void Start() { //デフォルトでプレイヤーが設定されてない場合 if (player == null) { try { player = GameObject.FindGameObjectWithTag("Player"); } catch (System.NullReferenceException) { Debug.Log("プレイヤー未発見" + name); Destroy(gameObject); } } //デフォルトで泥棒が設定されてない場合 if (thief == null) { try { thief = GameObject.FindGameObjectWithTag("Thief"); } catch (System.NullReferenceException) { Debug.Log("Thief未発見" + name); Destroy(gameObject); } } //泥棒が見つかったら if (thief != null) { trb = thief.GetComponent <Rigidbody>(); ifThiefHide = thief.GetComponent <thiefHide>().ifHide; } GhostAnim = GetComponentInChildren <GhostAnimationController>(); SE = GetComponent <Ghost_Sound>(); SE.playSE(); GameOver = false; }