public CNSState CreateStateEvent(CnsStateTriggerType evtType, CnsStateType type) { if (evtType == CnsStateTriggerType.none) { return(null); } CNSState state = new CNSState(evtType, type); int key = (int)evtType; List <CNSState> list; if (m_StateEventsMap == null) { m_StateEventsMap = new Dictionary <int, List <CNSState> >(); list = null; } else { if (!m_StateEventsMap.TryGetValue(key, out list)) { list = null; } } if (list == null) { list = new List <CNSState>(); m_StateEventsMap[key] = list; } list.Add(state); return(state); }
public void OnStateEvent(PlayerDisplay display, CnsStateTriggerType evtType) { if (display == null) { return; } // 触发状态事件 if (m_StateEventsMap != null) { int key = (int)evtType; List <CNSState> list; if (m_StateEventsMap.TryGetValue(key, out list)) { for (int i = 0; i < list.Count; ++i) { CNSState state = list [i]; if (state != null) { state.Call_TriggerEvent(display); } } } } }
static int CreateStateEvent(IntPtr L) { try { ToLua.CheckArgsCount(L, 3); Mugen.CNSStateDef obj = (Mugen.CNSStateDef)ToLua.CheckObject <Mugen.CNSStateDef>(L, 1); Mugen.CnsStateTriggerType arg0 = (Mugen.CnsStateTriggerType)ToLua.CheckObject(L, 2, typeof(Mugen.CnsStateTriggerType)); Mugen.CnsStateType arg1 = (Mugen.CnsStateType)ToLua.CheckObject(L, 3, typeof(Mugen.CnsStateType)); Mugen.CNSState o = obj.CreateStateEvent(arg0, arg1); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_value4(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Mugen.CNSState obj = (Mugen.CNSState)o; int ret = obj.value4; LuaDLL.lua_pushinteger(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index value4 on a nil value"); } }
static int set_OnTriggerEvent(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Mugen.CNSState obj = (Mugen.CNSState)o; System.Action<LuaInterface.LuaTable,Mugen.CNSState> arg0 = (System.Action<LuaInterface.LuaTable,Mugen.CNSState>)ToLua.CheckDelegate<System.Action<LuaInterface.LuaTable,Mugen.CNSState>>(L, 2); obj.OnTriggerEvent = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index OnTriggerEvent on a nil value"); } }
static int set_projanim(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Mugen.CNSState obj = (Mugen.CNSState)o; int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.projanim = arg0; return 0; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index projanim on a nil value"); } }
static int get_OnTriggerEvent(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Mugen.CNSState obj = (Mugen.CNSState)o; System.Action<LuaInterface.LuaTable,Mugen.CNSState> ret = obj.OnTriggerEvent; ToLua.Push(L, ret); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e, o, "attempt to index OnTriggerEvent on a nil value"); } }
public bool OnStateEvent(PlayerDisplay display, CnsStateTriggerType evtType, System.Object userData = null) { if (display == null) { return(false); } if (evtType == CnsStateTriggerType.Hited) { if (m_NotHit != null) { if (m_NotHit.CheckPlayer(display, userData as PlayerDisplay)) { return(false); } } return(true); } if (evtType == CnsStateTriggerType.AnimTime) { UpdateNotHit(display); } // 触发状态事件 if (m_StateEventsMap != null) { int key = (int)evtType; List <CNSState> list; if (m_StateEventsMap.TryGetValue(key, out list)) { for (int i = 0; i < list.Count; ++i) { CNSState state = list [i]; if (state != null && (!display.IsStatePersistent(state))) { state.Call_TriggerEvent(display); } } } } return(true); }