private void Update() { if (state == State.WalkingIn) { if (_spriteRenderer.color.a < 1f) { goToSeat(); } else { state = State.Ordering; _spriteRenderer.sprite = _sitting; _spriteRenderer.color = Color.white; createDish(); } } else if (state == State.Ordering) { if (!gotFood) { return; } else { state = State.Eating; bubble.ChangeSprite(null); _catSource = GetComponent <AudioSource>(); _catSource.volume = 1.0f; _catSource.PlayOneShot(CatHappyClip); } } else if (state == State.Eating) { state = State.WalkingOut; seat.Customer = null; } else { leave(); } }
private void OnMouseEnter() { bubble.ChangeSprite(foodDisplay); }