public void Clear() { this.ev = null; this.def = null; this.firstBlock = null; this.hasUndefinedblocks = false; this.unlinkedBlocks.Clear(); }
public void Clear() { this._loading = false; plyEdCoroutine loader = this._loader; if (loader != null) { loader.Stop(); } this.ev = null; this.def = null; this.firstBlock = null; this.hasUndefinedblocks = false; this.unlinkedBlocks.Clear(); }
public void Set(BloxEvent ev, bool forScriptGen = false) { Debug.Log("Set ", "BloxEventEd", UnityEngine.Color.green); if (this.ev != ev) { this.hasUndefinedblocks = false; this.Clear(); if (ev != null) { this.def = BloxEd.Instance.FindEventDef(ev); if (this.def != null) { this.ev = ev; if (forScriptGen) { Debug.Log("forScriptGen " + forScriptGen, "BloxEventEd", UnityEngine.Color.green); this.firstBlock = ((ev.firstBlock == null) ? null : new BloxBlockEd(ev.firstBlock, null, null, null, -1, false)); if (this.firstBlock != null) { BloxBlockEd next = this.firstBlock; while (next.b.next != null) { next.next = new BloxBlockEd(next.b.next, next, null, null, -1, false); next = next.next; } } } else { Debug.Log("forScriptGen " + forScriptGen, "BloxEventEd", UnityEngine.Color.green); this._loading = true; this._loader = plyEdCoroutine.Start(this.LoadEvent(), true); } } } } }
public void Set(BloxEvent ev, bool loadUnlinkedBlocks = true) { this.hasUndefinedblocks = false; if (this.ev != ev) { this.Clear(); if (ev != null) { this.def = BloxEd.Instance.FindEventDef(ev); if (this.def != null) { this.ev = ev; this.firstBlock = ((ev.firstBlock == null) ? null : new BloxBlockEd(ev.firstBlock, null, null, null, -1)); if (loadUnlinkedBlocks) { for (int i = 0; i < ev.unlinkedBlocks.Count; i++) { this.unlinkedBlocks.Add(new BloxBlockEd(ev.unlinkedBlocks[i], null, null, null, -1)); } } } } } }
public void SetActiveEventDef(BloxEventDef def) { this.activeEventDef = def; this.SetShownDef(this.activeEventDef); }
private IEnumerator LoadEventDefs() { Debug.Log("LoadEventDefs ", "BloxEditor.BloxEventsPopup", Color.green); BloxEd.Instance.LoadEventDefs(); while (BloxEd.Instance.EventDefsLoading) { yield return((object)null); } plyEdTreeItem <BloxEventDef> treeRoot = new plyEdTreeItem <BloxEventDef> { children = new List <plyEdTreeItem <BloxEventDef> >() }; int count = 0; int countBeforeYield = 20; List <BloxEventDef> .Enumerator enumerator = BloxEd.Instance.eventDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { BloxEventDef current = enumerator.Current; string[] array = current.ident.Split('/'); plyEdTreeItem <BloxEventDef> plyEdTreeItem = treeRoot; for (int i = 0; i < array.Length - 1; i++) { string text = array[i]; bool flag = false; if (plyEdTreeItem.children == null) { plyEdTreeItem.children = new List <plyEdTreeItem <BloxEventDef> >(); } foreach (plyEdTreeItem <BloxEventDef> child in plyEdTreeItem.children) { if (child.label == text) { flag = true; plyEdTreeItem = child; break; } } if (!flag) { plyEdTreeItem <BloxEventDef> plyEdTreeItem2 = new plyEdTreeItem <BloxEventDef> { label = text }; plyEdTreeItem.AddChild(plyEdTreeItem2); plyEdTreeItem = plyEdTreeItem2; if (plyEdTreeItem2.parent == treeRoot) { plyEdTreeItem2.icon = BloxEdGUI.Instance.folderIcon; } } } if (plyEdTreeItem.children == null) { plyEdTreeItem.children = new List <plyEdTreeItem <BloxEventDef> >(); } plyEdTreeItem.children.Add(new plyEdTreeItem <BloxEventDef> { icon = ((current.iconName == null) ? null : BloxEdGUI.Instance.namedIcons[current.iconName]), label = array[array.Length - 1], data = current }); count++; if (count >= countBeforeYield) { count = 0; yield return((object)null); } } } finally { ((IDisposable)enumerator).Dispose(); } enumerator = default(List <BloxEventDef> .Enumerator); this.treeView = new plyEdTreeView <BloxEventDef>(null, treeRoot, BloxEdGUI.Instance.folderIcon, "Events"); }