public void RegisterHandler(sourceAPIDelegate sourceAPI, bool isBlock) { APITemplate api = new APITemplate(); api.sourceAPI = sourceAPI; api.isBlock = isBlock; _sourceAPIQueue.Enqueue(api); }
// Update is called once per frame void Update() { //clear all msg boxes if no API is waiting if (_sourceAPI == null) { //close msg box lv 1 if (_msgBoxLv1 != null) { UIMessageBoxManager.Instance.CloseMessageBox(_msgBoxLv1); _msgBoxLv1 = null; } } //if queue has APIs and current API is null, pop up one API if ((_sourceAPIQueue.Count > 0) && (_sourceAPI == null)) { APITemplate api = _sourceAPIQueue.Dequeue(); DoHandler(api.sourceAPI, api.isBlock); } }