// Token: 0x06001FBE RID: 8126 RVA: 0x00183C80 File Offset: 0x00181E80
 private void Update()
 {
     YandereController.rightButton = false;
     YandereController.leftButton  = false;
     if (Input.GetAxisRaw("Horizontal") > 0f || Input.GetKey("right") || Input.GetAxis("DpadX") > 0.5f)
     {
         if (!this.rightButtonPast)
         {
             this.rightButtonPast          = true;
             YandereController.rightButton = true;
         }
     }
     else if (Input.GetAxisRaw("Horizontal") < 0f || Input.GetKey("left") || Input.GetAxis("DpadX") < -0.5f)
     {
         if (!this.leftButtonPast)
         {
             this.leftButtonPast          = true;
             YandereController.leftButton = true;
         }
     }
     else
     {
         this.leftButtonPast  = false;
         this.rightButtonPast = false;
     }
     if (base.transform.position.x < this.leftBounds.position.x)
     {
         base.transform.position = new Vector3(this.leftBounds.position.x, base.transform.position.y, base.transform.position.z);
     }
     if (base.transform.position.x > this.rightBounds.position.x)
     {
         base.transform.position = new Vector3(this.rightBounds.position.x, base.transform.position.y, base.transform.position.z);
     }
     if (Input.GetButtonDown("A") && this.aiTarget != null)
     {
         if (this.aiTarget.state == AIController.AIState.Menu)
         {
             this.aiTarget.TakeOrder();
             InteractionMenu.SetAButton(InteractionMenu.AButtonText.None);
         }
         else if (this.aiTarget.state == AIController.AIState.Waiting && this.heldItem != null)
         {
             this.aiTarget.DeliverFood(this.heldItem);
             SFXController.PlaySound(SFXController.Sounds.Plate);
             InteractionMenu.SetAButton(InteractionMenu.AButtonText.None);
             this.DropTray();
         }
     }
     if (this.aiTarget != null)
     {
         this.interactionIndicator.gameObject.SetActive(true);
         this.interactionIndicator.position = new Vector3(this.aiTarget.transform.position.x, this.aiTarget.transform.position.y + 0.6f, this.aiTarget.transform.position.z);
         return;
     }
     this.interactionIndicator.gameObject.SetActive(false);
 }
예제 #2
0
 // Token: 0x06001FEA RID: 8170 RVA: 0x001888E0 File Offset: 0x00186AE0
 private void Start()
 {
     this.leaveTarget.GetComponent <CustomerSpawner>().OpenDoor();
     this.moveSpeed           = GameController.Instance.activeDifficultyVariables.customerMoveSpeed;
     this.timeToOrder         = GameController.Instance.activeDifficultyVariables.timeSpentOrdering;
     this.eatTime             = GameController.Instance.activeDifficultyVariables.timeSpentEatingFood;
     this.patienceDegradation = GameController.Instance.activeDifficultyVariables.customerPatienceDegradation;
     this.timeToEat           = GameController.Instance.activeDifficultyVariables.timeSpentEatingFood;
     SFXController.PlaySound(SFXController.Sounds.DoorBell);
 }
예제 #3
0
 private void DecrementSelection()
 {
     if (this.activeIndex == 0)
     {
         this.SetActive(this.menuSlots.Count - 1);
     }
     else
     {
         this.SetActive(this.activeIndex - 1);
     }
     SFXController.PlaySound(SFXController.Sounds.MenuSelect);
 }
예제 #4
0
        private void Update()
        {
            if (this.cancelInputs)
            {
                return;
            }
            if ((Input.GetMouseButtonDown(0) || Input.GetButtonDown("A")) && this.activeMenuButton != null)
            {
                this.activeMenuButton.DoClick();
            }
            float num = Input.GetAxisRaw("Vertical") * -1f;

            if (Input.GetKeyDown("up") || Input.GetAxis("DpadY") > 0.5f)
            {
                num = -1f;
            }
            else if (Input.GetKeyDown("down") || Input.GetAxis("DpadY") < -0.5f)
            {
                num = 1f;
            }
            if (num != 0f && this.PreviousFrameVertical == 0f)
            {
                SFXController.PlaySound(SFXController.Sounds.MenuSelect);
            }
            this.PreviousFrameVertical = num;
            if (num != 0f)
            {
                if (!this.prevVertical)
                {
                    this.prevVertical = true;
                    if (num >= 0f)
                    {
                        int num2 = this.mainMenuButtons.IndexOf(this.activeMenuButton);
                        this.SetActiveMenuButton((num2 + 1) % this.mainMenuButtons.Count);
                        return;
                    }
                    int num3 = this.mainMenuButtons.IndexOf(this.activeMenuButton);
                    if (num3 == 0)
                    {
                        this.SetActiveMenuButton(this.mainMenuButtons.Count - 1);
                        return;
                    }
                    this.SetActiveMenuButton(num3 - 1);
                    return;
                }
            }
            else
            {
                this.prevVertical = false;
            }
        }
예제 #5
0
        // Token: 0x06002062 RID: 8290 RVA: 0x0018AB68 File Offset: 0x00188D68
        public void DoClick()
        {
            switch (this.buttonType)
            {
            case MenuButton.ButtonType.Start:
                this.menu.flipBook.FlipToPage(2);
                return;

            case MenuButton.ButtonType.Controls:
                this.menu.flipBook.FlipToPage(3);
                return;

            case MenuButton.ButtonType.Credits:
                this.menu.flipBook.FlipToPage(4);
                return;

            case MenuButton.ButtonType.Exit:
                this.menu.StopInputs();
                GameController.GoToExitScene(true);
                return;

            case MenuButton.ButtonType.Easy:
                this.menu.StopInputs();
                GameController.Instance.activeDifficultyVariables = GameController.Instance.easyVariables;
                GameController.Instance.LoadScene(this.targetScene);
                SFXController.PlaySound(SFXController.Sounds.MenuConfirm);
                return;

            case MenuButton.ButtonType.Medium:
                this.menu.StopInputs();
                GameController.Instance.activeDifficultyVariables = GameController.Instance.mediumVariables;
                GameController.Instance.LoadScene(this.targetScene);
                SFXController.PlaySound(SFXController.Sounds.MenuConfirm);
                return;

            case MenuButton.ButtonType.Hard:
                this.menu.StopInputs();
                GameController.Instance.activeDifficultyVariables = GameController.Instance.hardVariables;
                GameController.Instance.LoadScene(this.targetScene);
                SFXController.PlaySound(SFXController.Sounds.MenuConfirm);
                return;

            default:
                return;
            }
        }
예제 #6
0
 // Token: 0x06001FF0 RID: 8176 RVA: 0x00188C58 File Offset: 0x00186E58
 public void TakeOrder()
 {
     this.state     = AIController.AIState.Ordering;
     this.happiness = 100f;
     this.happinessMeter.SetFill(this.happiness / 100f);
     this.orderTime = this.timeToOrder;
     this.animator.SetTrigger("OrderTaken");
     this.animator.SetFloat("Happiness", this.happiness);
     this.desiredFood = FoodMenu.Instance.GetRandomFood();
     this.speechBubble.gameObject.SetActive(true);
     this.speechBubble.food = this.desiredFood;
     if (this.Male)
     {
         SFXController.PlaySound(SFXController.Sounds.MaleCustomerGreet);
         return;
     }
     SFXController.PlaySound(SFXController.Sounds.FemaleCustomerGreet);
 }
예제 #7
0
        // Token: 0x0600203F RID: 8255 RVA: 0x0018A631 File Offset: 0x00188831
        private IEnumerator CountdownToStart()
        {
            yield return(new WaitForSeconds(GameController.Instance.activeDifficultyVariables.transitionTime));

            SFXController.PlaySound(SFXController.Sounds.Countdown);
            while (this.timeToStart > 0)
            {
                yield return(new WaitForSeconds(1f));

                this.timeToStart--;
                this.spriteRenderer.sprite = this.numbers[this.timeToStart];
            }
            yield return(new WaitForSeconds(1f));

            GameController.SetPause(false);
            this.spriteRenderer.sprite = null;
            yield break;
        }
예제 #8
0
        // Token: 0x0600203D RID: 8253 RVA: 0x0018A5CC File Offset: 0x001887CC
        public void SetGameTime(float gameTime)
        {
            int num = Mathf.CeilToInt(gameTime);

            if ((float)num == 10f)
            {
                SFXController.PlaySound(SFXController.Sounds.ClockTick);
            }
            if (gameTime > 3f)
            {
                return;
            }
            if (num - 1 <= 2)
            {
                this.spriteRenderer.sprite = this.numbers[num];
                return;
            }
            this.EndGame();
        }
예제 #9
0
        // Token: 0x06001FD1 RID: 8145 RVA: 0x00184954 File Offset: 0x00182B54
        public void AddPlate(Food food)
        {
            if (this.plates.Count >= this.maxPlates)
            {
                this.RemovePlate(this.maxPlates - 1);
                this.selectedIndex--;
            }
            for (int i = 0; i < this.plates.Count; i++)
            {
                FoodInstance foodInstance = this.plates[i];
                foodInstance.transform.parent        = this.platePositions[i + 1];
                foodInstance.transform.localPosition = Vector3.zero;
            }
            SFXController.PlaySound(SFXController.Sounds.Plate);
            FoodInstance foodInstance2 = UnityEngine.Object.Instantiate <FoodInstance>(this.platePrefab);

            foodInstance2.transform.parent        = this.platePositions[0];
            foodInstance2.transform.localPosition = Vector3.zero;
            foodInstance2.food = food;
            this.plates.Insert(0, foodInstance2);
        }
예제 #10
0
 // Token: 0x06001FF1 RID: 8177 RVA: 0x00188D0C File Offset: 0x00186F0C
 public void DeliverFood(Food deliveredFood)
 {
     if (deliveredFood.name == this.desiredFood.name)
     {
         this.state = AIController.AIState.Eating;
         this.animator.SetTrigger("ServedFood");
         this.eatTime = this.timeToEat;
         GameController.AddTip(GameController.Instance.activeDifficultyVariables.baseTip * this.happiness);
         if (this.happiness <= 50f)
         {
             this.happiness = 50f;
             this.animator.SetFloat("Happiness", this.happiness);
         }
         if (this.Male)
         {
             SFXController.PlaySound(SFXController.Sounds.MaleCustomerThank);
         }
         else
         {
             SFXController.PlaySound(SFXController.Sounds.FemaleCustomerThank);
         }
     }
     else
     {
         this.state     = AIController.AIState.Leaving;
         this.happiness = 0f;
         this.animator.SetFloat("Happiness", this.happiness);
         GameController.AddAngryCustomer();
         this.StandUp();
         if (this.Male)
         {
             SFXController.PlaySound(SFXController.Sounds.MaleCustomerLeave);
         }
         else
         {
             SFXController.PlaySound(SFXController.Sounds.FemaleCustomerLeave);
         }
     }
     this.happinessMeter.gameObject.SetActive(false);
 }
예제 #11
0
 // Token: 0x0600203E RID: 8254 RVA: 0x0018A61C File Offset: 0x0018881C
 public void EndGame()
 {
     base.StartCoroutine(this.EndGameRoutine());
     SFXController.PlaySound(SFXController.Sounds.GameSuccess);
 }
 // Token: 0x0600202F RID: 8239 RVA: 0x00185998 File Offset: 0x00183B98
 public static void GameFailed()
 {
     FailGame.Instance.StartCoroutine(FailGame.Instance.GameFailedRoutine());
     FailGame.Instance.StartCoroutine(FailGame.Instance.SlowPitch());
     SFXController.PlaySound(SFXController.Sounds.GameFail);
 }
예제 #13
0
 // Token: 0x06002053 RID: 8275 RVA: 0x0018A86B File Offset: 0x00188A6B
 public void FlipToPage(int page)
 {
     SFXController.PlaySound(SFXController.Sounds.PageTurn);
     base.StartCoroutine(this.FlipToPageRoutine(page));
 }
예제 #14
0
 private void IncrementSelection()
 {
     this.SetActive((this.activeIndex + 1) % this.menuSlots.Count);
     SFXController.PlaySound(SFXController.Sounds.MenuSelect);
 }
예제 #15
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;
            }
        }