Beispiel #1
0
        public void ApplyUse(IInteractionComponent interactor)
        {
            switch (state)
            {
            case States.None:
                if (interactor.CurrentItem is Cup c && !c.HasCoffee)
                {
                    state = States.Operating;
                    TakeCup((Cup)interactor.RemoveItem());
                    GameManager.Gameplay.DisablePlayerInput();
                }
                break;

            case States.Ready:
                if (interactor.ReceiveItem(heldCup))
                {
                    heldCup.gameObject.SetActive(true);
                    heldCup.AddCoffee(true);
                    cupVisual.gameObject.SetActive(false);
                    heldCup = null;
                    state   = States.None;
                }
                break;
            }
        }
Beispiel #2
0
        private IEnumerator Dispense()
        {
            animator.SetBool(IsDispensingAnimProp, true);
            cupVisual.AddCoffee(false);

            yield return(new WaitForSeconds(1.2f));

            state = States.Ready;
            animator.SetBool(IsDispensingAnimProp, false);

            yield return(new WaitForSeconds(0.5f));

            GameManager.Camera.UnZoom();
            GameManager.Gameplay.EnablePlayerInput();
        }