예제 #1
0
파일: Fridge.cs 프로젝트: Ittaimann/GGJ2019
 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);
 }
예제 #2
0
파일: Oven.cs 프로젝트: Ittaimann/GGJ2019
    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;
        }
    }
예제 #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;
     }
 }