private void Next() { // Run the old event's end state if (_current != null) { _current.End(); _actions.Dequeue(); //UnityEngine.Debug.Log("ENDING " + _current.GetType() + "\n" + DebugLog()); } // Switch to the new event if (_actions.Count > 0) { _current = _actions.Peek(); if (_current != null) { // Run the new event's begin state _current.Begin(); } else { // End of events or a null-event which shall not exist } } }
//public void AddiTween(iTween piTween) //{ // _actions.Enqueue(new CerealEvent() // { // OnBegin = () => // { // piTween.Invoke(); // }, // }); //} public void Add(ICerealEvent e) { _actions.Enqueue(e); }
private void Next() { // Run the old event's end state if (_current != null) { _current.End(); _actions.Dequeue(); //UnityEngine.Debug.Log("ENDING " + _current.GetType() + "\n" + DebugLog()); } // Switch to the new event if (_actions.Count > 0) { _current = _actions.Peek(); if (_current != null) { // Run the new event's begin state _current.Begin(); } else { // End of events or a null-event which shall not exist } } }
//public void AddiTween(iTween piTween) //{ // _actions.Enqueue(new CerealEvent() // { // OnBegin = () => // { // piTween.Invoke(); // }, // }); //} public void Add(ICerealEvent e) { _actions.Enqueue(e); }