public static Delegate CreateDelegate(Type t, LuaFunction func = null) { DelegateFactory.DelegateValue delegateValue = null; if (!DelegateFactory.dict.TryGetValue(t, ref delegateValue)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t)), null, 1); } return(delegateValue(func)); }
public static Delegate CreateDelegate(Type t, LuaFunction func) { DelegateFactory.DelegateValue delegateValue = null; if (!DelegateFactory.dict.TryGetValue(t, ref delegateValue)) { Debug.LogError("Delegate " + t.get_FullName() + " not register"); return(null); } return(delegateValue(func)); }
public static Delegate CreateDelegate(Type t, LuaFunction func) { DelegateFactory.DelegateValue delegateValue = null; if (!DelegateFactory.dict.TryGetValue(t, out delegateValue)) { Debugger.LogError("Delegate {0} not register", new object[] { t.FullName }); return(null); } return(delegateValue(func)); }
public static Delegate CreateDelegate(Type t, LuaFunction func, LuaTable self) { DelegateFactory.DelegateValue delegateValue = null; if (!DelegateFactory.dict.TryGetValue(t, out delegateValue)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t)), null, 1); } if (!(func != null)) { return(delegateValue(func, self, true)); } LuaState luaState = func.GetLuaState(); LuaDelegate luaDelegate = luaState.GetLuaDelegate(func, self); if (luaDelegate != null) { return(Delegate.CreateDelegate(t, luaDelegate, luaDelegate.method)); } Delegate @delegate = delegateValue(func, self, true); luaDelegate = (@delegate.Target as LuaDelegate); luaState.AddLuaDelegate(luaDelegate, func, self); return(@delegate); }