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); } } }
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(); } }
public void InsertBread(IToastable toastable) { this.toastable = toastable; System.Console.WriteLine($"Bread inseted into slot."); }