private void LoadLuaScriptFailureCallback(string luaScriptAssetName, LoadResourceStatus status, string errorMessage, object userData) { LuaScriptInfo luaScriptInfo = (LuaScriptInfo)userData; string appendErrorMessage = string.Format("Load lua script failure, asset name '{0}', status '{1}', error message '{2}'.", luaScriptAssetName, status.ToString(), errorMessage); GameEntry.Event.Fire(this, ReferencePool.Acquire <LoadLuaScriptFailureEventArgs>().Fill(luaScriptInfo.LuaScriptName, luaScriptAssetName, appendErrorMessage, luaScriptInfo.UserData)); }
private void LoadLuaScriptSuccessCallback(string luaScriptAssetName, object asset, float duration, object userData) { TextAsset luaScriptAsset = asset as TextAsset; if (luaScriptAsset == null) { Log.Warning("Lua script asset '{0}' is invalid.", luaScriptAssetName); return; } LuaScriptInfo luaScriptInfo = (LuaScriptInfo)userData; byte[] bytes = luaScriptAsset.bytes; InternalLoadLuaScript(luaScriptInfo.LuaScriptName, luaScriptAssetName, bytes, duration, luaScriptInfo.UserData); }