private void Awake()
 {
     InteractionMenu.SetAButton(InteractionMenu.AButtonText.None);
     InteractionMenu.SetBButton(false);
     InteractionMenu.SetADButton(true);
 }
Example #2
0
        // Token: 0x06001FCF RID: 8143 RVA: 0x00184368 File Offset: 0x00182568
        private void Update()
        {
            switch (this.state)
            {
            case ServingCounter.KitchenState.None:
                if (this.isPaused)
                {
                    return;
                }
                if (this.interactionRange && Input.GetButtonDown("A"))
                {
                    this.state         = ServingCounter.KitchenState.SelectingInteraction;
                    this.selectedIndex = ((this.plates.Count == 0) ? 2 : 0);
                    this.kitchenModeHide.gameObject.SetActive(true);
                    this.SetMask(this.selectedIndex);
                    SFXController.PlaySound(SFXController.Sounds.MenuOpen);
                    if (this.plates.Count == 0 && YandereController.Instance.heldItem == null)
                    {
                        this.interactionIndicator.transform.position = Chef.Instance.transform.position + Vector3.up * 0.8f;
                        InteractionMenu.SetAButton(InteractionMenu.AButtonText.PlaceOrder);
                        this.state = ServingCounter.KitchenState.Chef;
                        FoodMenu.Instance.gameObject.SetActive(true);
                    }
                    GameController.SetPause(true);
                    InteractionMenu.SetBButton(true);
                    return;
                }
                break;

            case ServingCounter.KitchenState.SelectingInteraction:
                switch (this.selectedIndex)
                {
                case 0:
                    this.interactionIndicator.transform.position = this.interactionIndicatorStartingPos;
                    InteractionMenu.SetAButton(InteractionMenu.AButtonText.ChoosePlate);
                    this.SetMask(this.selectedIndex);
                    if (Input.GetButtonDown("A"))
                    {
                        this.state         = ServingCounter.KitchenState.Plates;
                        this.selectedIndex = 0;
                        InteractionMenu.SetAButton(InteractionMenu.AButtonText.GrabPlate);
                        SFXController.PlaySound(SFXController.Sounds.MenuOpen);
                    }
                    break;

                case 1:
                    this.interactionIndicator.transform.position = this.trash.transform.position + Vector3.up * 0.5f;
                    InteractionMenu.SetAButton(InteractionMenu.AButtonText.TossPlate);
                    this.SetMask(this.selectedIndex);
                    if (Input.GetButtonDown("A"))
                    {
                        this.state = ServingCounter.KitchenState.Trash;
                        SFXController.PlaySound(SFXController.Sounds.MenuOpen);
                    }
                    break;

                case 2:
                    this.interactionIndicator.transform.position = Chef.Instance.transform.position + Vector3.up * 0.8f;
                    InteractionMenu.SetAButton(InteractionMenu.AButtonText.PlaceOrder);
                    this.SetMask(this.selectedIndex);
                    if (Input.GetButtonDown("A"))
                    {
                        this.state = ServingCounter.KitchenState.Chef;
                        InteractionMenu.SetAButton(InteractionMenu.AButtonText.PlaceOrder);
                        FoodMenu.Instance.gameObject.SetActive(true);
                        SFXController.PlaySound(SFXController.Sounds.MenuOpen);
                    }
                    break;
                }
                if (Input.GetButtonDown("B"))
                {
                    InteractionMenu.SetBButton(false);
                    InteractionMenu.SetAButton(InteractionMenu.AButtonText.KitchenMenu);
                    this.state = ServingCounter.KitchenState.None;
                    GameController.SetPause(false);
                    this.kitchenModeHide.gameObject.SetActive(false);
                    this.interactionIndicator.transform.position = this.interactionIndicatorStartingPos;
                    SFXController.PlaySound(SFXController.Sounds.MenuBack);
                }
                if (YandereController.rightButton)
                {
                    this.selectedIndex = (this.selectedIndex + 1) % 3;
                    if (this.selectedIndex == 0 && this.plates.Count == 0)
                    {
                        this.selectedIndex = (this.selectedIndex + 1) % 3;
                    }
                    if (this.selectedIndex == 1 && YandereController.Instance.heldItem == null)
                    {
                        this.selectedIndex = (this.selectedIndex + 1) % 3;
                    }
                    SFXController.PlaySound(SFXController.Sounds.MenuSelect);
                }
                if (YandereController.leftButton)
                {
                    if (this.selectedIndex == 0)
                    {
                        this.selectedIndex = 2;
                    }
                    else
                    {
                        this.selectedIndex--;
                    }
                    if (this.selectedIndex == 1 && YandereController.Instance.heldItem == null)
                    {
                        this.selectedIndex--;
                    }
                    if (this.selectedIndex == 0 && this.plates.Count == 0)
                    {
                        this.selectedIndex = 2;
                    }
                    SFXController.PlaySound(SFXController.Sounds.MenuSelect);
                    return;
                }
                break;

            case ServingCounter.KitchenState.Plates:
                this.interactionIndicator.gameObject.SetActive(true);
                this.interactionIndicator.transform.position = this.plates[this.selectedIndex].transform.position + Vector3.up * 0.25f;
                this.SetMask(3);
                this.plateMask.transform.position = this.plates[this.selectedIndex].transform.position + Vector3.up * 0.05f;
                if (YandereController.rightButton)
                {
                    if (this.selectedIndex == 0)
                    {
                        this.selectedIndex = this.plates.Count - 1;
                    }
                    else
                    {
                        this.selectedIndex--;
                    }
                    SFXController.PlaySound(SFXController.Sounds.MenuSelect);
                }
                else if (YandereController.leftButton)
                {
                    this.selectedIndex = (this.selectedIndex + 1) % this.plates.Count;
                    SFXController.PlaySound(SFXController.Sounds.MenuSelect);
                }
                if (Input.GetButtonDown("A") && YandereController.Instance.heldItem == null)
                {
                    YandereController.Instance.PickUpTray(this.plates[this.selectedIndex].food);
                    this.RemovePlate(this.selectedIndex);
                    this.selectedIndex = 2;
                    this.state         = ServingCounter.KitchenState.SelectingInteraction;
                    SFXController.PlaySound(SFXController.Sounds.MenuOpen);
                }
                if (Input.GetButtonDown("B"))
                {
                    this.state = ServingCounter.KitchenState.SelectingInteraction;
                    SFXController.PlaySound(SFXController.Sounds.MenuBack);
                    return;
                }
                break;

            case ServingCounter.KitchenState.Chef:
                if (Input.GetButtonDown("B"))
                {
                    this.state = ServingCounter.KitchenState.SelectingInteraction;
                    FoodMenu.Instance.gameObject.SetActive(false);
                    this.state = ServingCounter.KitchenState.SelectingInteraction;
                    SFXController.PlaySound(SFXController.Sounds.MenuBack);
                }
                if (Input.GetButtonDown("A"))
                {
                    this.state = ServingCounter.KitchenState.SelectingInteraction;
                    Chef.AddToQueue(FoodMenu.Instance.GetActiveFood());
                    FoodMenu.Instance.gameObject.SetActive(false);
                    SFXController.PlaySound(SFXController.Sounds.MenuOpen);
                    return;
                }
                break;

            case ServingCounter.KitchenState.Trash:
                YandereController.Instance.DropTray();
                this.state         = ServingCounter.KitchenState.SelectingInteraction;
                this.selectedIndex = 2;
                break;

            default:
                return;
            }
        }