private void LateUpdate() { if (this.currentTask == null && this.taskQueue.Count > 0) { this.currentTask = this.taskQueue[0]; this.taskQueue.RemoveAt(0); UIAssets.LoadWindowAsync(this.currentTask.windowName, (bool ok, UnityEngine.Object _resource) => { try { if (this.currentTask != null) { this.currentTask.Done(ok, _resource); this.currentTask = null; } } catch (Exception ex) { DebugEx.Log(ex); } finally { PleaseWait.Instance.Hide(PleaseWait.WaitType.WindowLoad); } }); } }
public void SetWidgetActive <T>(bool value) where T : Widget { var widget = this.widgets.Find((x) => { return(x != null && x is T); }); if (value) { if (widget != null) { widget.SetActive(true); } else { var name = typeof(T).Name; UIAssets.LoadWindowAsync(name, this.OnLoadWidget); } } else { if (widget != null) { widget.SetActive(false); } } }