private void SetState(Bowl.State state) { if (this.m_State == state) { return; } this.m_State = state; this.OnEnterState(); }
public float GetCookingLevel() { Bowl.State state = this.m_State; if (state != Bowl.State.UnsafeWaterCooking && state != Bowl.State.HerbCooking) { return(0f); } return((this.m_CookingLength <= 0f) ? 1f : (this.m_CookingDuration / this.m_CookingLength)); }
private void UpdateSounds() { Bowl.State state = this.m_State; if (state == Bowl.State.UnsafeWaterCooking || state == Bowl.State.HerbCooking) { if (this.m_CookingDuration >= this.m_CookingLength * 0.5f && this.m_AudioSource != null && !this.m_AudioSource.isPlaying) { this.m_AudioSource.clip = Bowl.s_BoilingSound[UnityEngine.Random.Range(0, Bowl.s_BoilingSound.Count)]; this.m_AudioSource.spatialBlend = 1f; this.m_AudioSource.Play(); return; } } else if (this.m_AudioSource != null && this.m_AudioSource.isPlaying) { this.m_AudioSource.Stop(); } }