Exemplo n.º 1
0
 private void AdvanceToast()
 {
     // Remove the current active toast
     if (ActiveToast != null)
     {
         Destroy(ActiveToast.GameObject);
     }
     ActiveToast = null;
     // Check if there is one inline and advance it
     if (_toastQueue.Count > 0)
     {
         ActiveToast = _toastQueue.Dequeue();
         if(ActiveToast.ToastAppearedSound != null)
         {
             _audioSource.PlayOneShot(ActiveToast.ToastAppearedSound);
         }
     }
 }
Exemplo n.º 2
0
 private void QueueToast(IToastable toast)
 {
     toast.GameObject.SetActive(false);
     toast.GameObject.transform.SetParent(_toastContainer);
     toast.GameObject.transform.localPosition = Vector3.zero;
     _toastQueue.Enqueue(toast);
     if(ActiveToast == null)
     {
         AdvanceToast();
     }
 }
Exemplo n.º 3
0
 public void InsertBread(IToastable toastable)
 {
     this.toastable = toastable;
     System.Console.WriteLine($"Bread inseted into slot.");
 }