Beispiel #1
0
 public void Activate(GameObject table, List <GameObject> drinks)
 {
     _inPlay = true;
     _table  = table;
     foreach (GameObject drink in drinks)
     {
         _tray.AddDrink(drink);
     }
 }
Beispiel #2
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject == _table)
     {
         if (OnReachedTable != null)
         {
             OnReachedTable(_table);
         }
         DrinkPlacement tablePlacement = _table.GetComponent <DrinkPlacement>();
         while (_tray.IsEmpty())
         {
             tablePlacement.AddDrink(_tray.GetDrink());
         }
         _table           = null;
         _goTowardsTarget = false;
     }
 }