void Update() { state.run(); state.updateState(); //prevent flying away // Rigidbody rb = GetComponent<Rigidbody>(); // rb.velocity = new Vector3(rb.velocity.x, 0, rb.velocity.z); }
void Update() { state.run(); state.updateState(); //prevent flying away // Rigidbody rb = GetComponent<Rigidbody>(); // rb.velocity = new Vector3(rb.velocity.x, 0, rb.velocity.z); cluckTimer -= Time.deltaTime; if (cluckTimer < 0) { cluckTimer = Random.Range(5f, 12f); SoundManager.SFXv2 cluck; switch (Random.Range(0, 5)) { case 0: cluck = SoundManager.SFXv2.cluck1; break; case 1: cluck = SoundManager.SFXv2.cluck2; break; case 2: cluck = SoundManager.SFXv2.cluck3; break; case 3: cluck = SoundManager.SFXv2.cluck4; break; case 4: cluck = SoundManager.SFXv2.cluck5; break; default: cluck = SoundManager.SFXv2.cluck3; break; } SoundManager.Instance().PlayAnySFX(cluck); } }