private SpecialEvent GetEvent(string eventId) { SpecialEvent ret = null; if (!EventDict.TryGetValue(eventId, out ret)) { EventAsset eventAsset = GameMain.GetInstance().GetModule <ResLoader>().LoadResource <EventAsset>("events/" + eventId); string eid = eventAsset.EventId; LogicNode node = pLogidTree.ConstructFromString(eventAsset.TriggerCondString); List <string> actions = new List <string>(eventAsset.Actions); ret = new SpecialEvent(eid, node, actions); EventDict.Add(eventId, ret); } return(ret); }
private EventAssetElement CreateDataGUI(VisualElement root, EventAsset asset) { var assetElem = new EventAssetElement { text = $"Event ({asset.Events.Count})", value = false, }; var theme = EditorGUIUtility.isProSkin ? "Dark" : "Light"; assetElem.styleSheets.Add(Resources.Load <StyleSheet>($"{nameof(EventAsset)}/Layout")); assetElem.styleSheets.Add(Resources.Load <StyleSheet>($"{nameof(EventAsset)}/{theme}Theme")); foreach (var kv in asset.Events) { CreateEventGUI(assetElem, kv.Value); } root.Add(assetElem); return(assetElem); }
private void OnEnable() { this.asset = this.target as EventAsset; }