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; } }
private void TakeCup(Cup c) { heldCup = c; heldCup.transform.SetParent(cupPlacementPoint); heldCup.gameObject.SetActive(false); cupVisual.gameObject.SetActive(true); }
public override void ResetState() { if (heldCup != null) { heldCup.Destroy(); heldCup = null; } cupVisual.ResetState(); cupVisual.gameObject.SetActive(false); }