public void WaitFor(FTEvent ev) { var native = new EventWaitHandle(false, EventResetMode.AutoReset); SetEventNotification(ev, native); native.WaitOne(); }
public void SetEventNotification(FTEvent evMask, EventWaitHandle waitHandle) { FTStatus status; if ((status = Native.FT_SetEventNotification(Handle, (int)evMask, waitHandle.SafeWaitHandle.DangerousGetHandle())) != FTStatus.Ok) { throw new FTException("FT_SetEventNotification", status); } }
public override void Import(DCFG cfg) { MapStep data = cfg as MapStep; this.ID = data.ID; this.StepName = data.StepName; FTGroupEvent group = Map.GetGroup <FTGroupEvent>(); for (int i = 0; i < data.StepEvents.Count; i++) { FTEvent e = group.GetElement(data.StepEvents[i]); if (e != null) { StepEvents.Add(e); } } }
public override void Import(DCFG cfg) { MapTimer data = cfg as MapTimer; this.ID = data.ID; this.TriggerTime = data.TriggerTime; this.TriggerLoops = data.TriggerLoops; FTGroupEvent group = Map.GetGroup <FTGroupEvent>(); for (int i = 0; i < data.TriggerEvents.Count; i++) { FTEvent e = group.GetElement(data.TriggerEvents[i]); if (e != null) { TriggerEvents.Add(e); } } }
public static void DrawEvents(FTWorldMap map, List <FTEvent> events) { #if UNITY_EDITOR GUILayout.Space(10); GUI.color = Color.green; if (GUILayout.Button("添加事件", FTGUIStyles.FTButtonStyle, GUILayout.Height(40))) { FTEditorHelper.ShowMenu(typeof(FTEvent), (obj) => { FTEvent e = map.GetGroup <FTGroupEvent>().AddEvent(obj as Type); events.Add(e); }); } for (int i = 0; i < events.Count; i++) { GUILayout.Label(events[i].name); } GUILayout.Space(10); GUI.color = Color.white; #endif }
public override void Import(DCFG cfg) { MapArea data = cfg as MapArea; this.ID = data.ID; this.Name = data.Name; this.Pos = data.Pos; this.Scale = data.Scale; this.Shape = (EAreaShape)data.Shape; this.AllowRide = data.AllowRide; this.AllowPK = data.AllowPK; this.AllowTrade = data.AllowTrade; FTGroupEvent group = Map.GetGroup <FTGroupEvent>(); for (int i = 0; i < data.Events.Count; i++) { FTEvent e = group.GetElement(data.Events[i]); if (e != null) { Events.Add(e); } } }
public void SetEventNotification(FTEvent evMask, EventWaitHandle waitHandle) { FTStatus status; if ((status = Native.FT_SetEventNotification(Handle, (int)evMask, waitHandle.SafeWaitHandle.DangerousGetHandle())) != FTStatus.Ok) throw new FTException("FT_SetEventNotification", status); }