public override void Interact(Pickup heldObject, PlayerInteractor player) { if (heldObject is RawFood) { return; } player.Drop(); player.SetHeldObject(Instantiate(foodPrefab, player.transform.position, Quaternion.identity), true); }
public override void Interact(Pickup heldObject, PlayerInteractor player) { if (heldObject is RawFood) { GameObject food = heldObject.gameObject; player.Drop(); Destroy(food); StartCoroutine(Cook(heldObject.gameObject)); } if (heldObject is Dish && isCooked) { heldObject.GetComponent <Dish>().AddFood(); isCooked = false; } }
public override void Interact(Pickup heldObject, PlayerInteractor player) { base.Interact(heldObject, player); if (heldObject is Dish) { player.Drop(); heldObject.transform.position = this.transform.position; dish = heldObject as Dish; } else if (dish != null && (dish.transform.position - this.transform.position).magnitude < 1) { dish.clean = true; sfx.Play(); vfx.Play(); gameDataScriptable.washedDishes = true; } }