public override void OnInitLua(GameLuaObjectHost host) { LuaFunction fun; self = host.LuaSelf; fun = self["OnApplicationFocus"] as LuaFunction; if (fun != null) { luaOnApplicationFocus = fun.cast <LuaBoolDelegate>(); } fun = self["OnApplicationPause"] as LuaFunction; if (fun != null) { luaOnApplicationPause = fun.cast <LuaBoolDelegate>(); } fun = self["OnApplicationQuit"] as LuaFunction; if (fun != null) { luaOnApplicationQuit = fun.cast <LuaVoidDelegate>(); } fun = self["OnValidate"] as LuaFunction; if (fun != null) { luaOnValidate = fun.cast <LuaVoidDelegate>(); } fun = self["OnDrawGizmos"] as LuaFunction; if (fun != null) { luaOnDrawGizmos = fun.cast <LuaVoidDelegate>(); } fun = self["OnDrawGizmosSelected"] as LuaFunction; if (fun != null) { luaOnDrawGizmosSelected = fun.cast <LuaVoidDelegate>(); } fun = self["OnBecameInvisible"] as LuaFunction; if (fun != null) { luaOnBecameInvisible = fun.cast <LuaVoidDelegate>(); } fun = self["OnBecameVisible"] as LuaFunction; if (fun != null) { luaOnBecameVisible = fun.cast <LuaVoidDelegate>(); } }
private void InitLuaFun() { self = GameLuaObjectHost.LuaSelf; LuaFunction fn = self["Active"] as LuaFunction; if (fn != null) { fnActive = fn.cast <LuaVector3Delegate>(); } fn = self["Deactive"] as LuaFunction; if (fn != null) { fnDeactive = fn.cast <LuaVoidDelegate>(); } fn = self["Init"] as LuaFunction; if (fn != null) { fnInit = fn.cast <LuaReturnBoolDelegate>(); } fn = self["Destroy"] as LuaFunction; if (fn != null) { fnDestroy = fn.cast <LuaVoidDelegate>(); } fn = self["BallPush"] as LuaFunction; if (fn != null) { fnBallPush = fn.cast <LuaVoidDelegate>(); } fn = self["EndControll"] as LuaFunction; if (fn != null) { fnEndControll = fn.cast <LuaBoolDelegate>(); } fn = self["Recover"] as LuaFunction; if (fn != null) { fnRecover = fn.cast <LuaVector3Delegate>(); } fn = self["RemoveSpeed"] as LuaFunction; if (fn != null) { fnRemoveSpeed = fn.cast <LuaVoidDelegate>(); } fn = self["StartControll"] as LuaFunction; if (fn != null) { fnStartControll = fn.cast <LuaVoidDelegate>(); } }