| | |
| | | public delegate void GeneralDelegate(); |
| | | static GeneralDelegate configInit; |
| | | |
| | | static GeneralDelegate beforePlayerDataInitialize; |
| | | static GeneralDelegate afterPlayerDataInitialize; |
| | | static GeneralDelegate switchAccount; |
| | | static GeneralDelegate playerLoginOk; |
| | | static GeneralDelegate mapInitOk; |
| | | |
| | | public static void Init() |
| | | { |
| | | LuaUtility.DoString("protocol.LuaProtocalRegister"); |
| | |
| | | |
| | | LuaUtility.DoString("protocol.CSharpProtocalEvent"); |
| | | onCSharpNetPackage = LuaUtility.Global.Get<CSharpNetPackage>("OnCSharpNetEvent"); |
| | | |
| | | LuaUtility.DoString("event.AfterPlayerDataInitialize"); |
| | | afterPlayerDataInitialize = LuaUtility.Global.Get<GeneralDelegate>("OnAfterPlayerDataInitialize"); |
| | | |
| | | LuaUtility.DoString("event.BeforePlayerDataInitialize"); |
| | | beforePlayerDataInitialize = LuaUtility.Global.Get<GeneralDelegate>("OnBeforePlayerDataInitialize"); |
| | | |
| | | LuaUtility.DoString("event.MapInitOk"); |
| | | mapInitOk = LuaUtility.Global.Get<GeneralDelegate>("OnMapInitOk"); |
| | | |
| | | LuaUtility.DoString("event.SwitchAccount"); |
| | | switchAccount = LuaUtility.Global.Get<GeneralDelegate>("OnSwitchAccount"); |
| | | |
| | | LuaUtility.DoString("event.PlayerLoginOk"); |
| | | playerLoginOk = LuaUtility.Global.Get<GeneralDelegate>("OnPlayerLoginOk"); |
| | | |
| | | LuaUtility.DoString("config.ConfigInit"); |
| | | configInit = LuaUtility.Global.Get<GeneralDelegate>("ConfigInit"); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void OnBeforePlayerDataInitialize() |
| | | { |
| | | if (beforePlayerDataInitialize != null) |
| | | { |
| | | beforePlayerDataInitialize(); |
| | | } |
| | | } |
| | | |
| | | public static void OnAfterPlayerDataInitialize() |
| | | { |
| | | if (afterPlayerDataInitialize != null) |
| | | { |
| | | afterPlayerDataInitialize(); |
| | | } |
| | | } |
| | | |
| | | public static void OnSwitchAccount() |
| | | { |
| | | if (switchAccount != null) |
| | | { |
| | | switchAccount(); |
| | | } |
| | | } |
| | | |
| | | public static void OnPlayerLoginOk() |
| | | { |
| | | if (playerLoginOk!=null) |
| | | { |
| | | playerLoginOk(); |
| | | } |
| | | } |
| | | |
| | | public static void OnMapInitOk() |
| | | { |
| | | if (mapInitOk != null) |
| | | { |
| | | mapInitOk(); |
| | | } |
| | | } |
| | | |
| | | } |