Example #1
0
 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);
 }
Example #2
0
    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;
        }
    }
Example #3
0
 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;
     }
 }