//--------------------------------------------------------------------- public void LoadIconAsync(string id, string resource_path, string resource_name, GameObject head_icon, Action <Texture> load_callback = null) { if (MapHeadIconResources.TryGetValue(id, out Texture head_resource)) { if (head_icon != null) { head_icon.SetActive(true); } if (load_callback != null) { load_callback(head_resource); } } else { if (MbAsyncLoadAssets == null) { var go = GameObject.Find("Launch"); MbAsyncLoadAssets = go.GetComponent <MbAsyncLoadAssets>(); } MbAsyncLoadAssets.WWWLoadTextureAsync(resource_path, load_callback); } }
//--------------------------------------------------------------------- public LuaMgr() { Context = CasinosContext.Instance; MapLuaFiles = new Dictionary <string, byte[]>(); //LuaEnv = new LuaEnv(); //LuaEnv.AddLoader(_luaLoaderCustom); var go_main = GameObject.Find(StringDef.GoMainObj); MbAsyncLoadAssets = go_main.GetComponent <MbAsyncLoadAssets>(); }
//--------------------------------------------------------------------- public void LoadTextureAsync(string name, string path, Action <Texture> call_back) { MapTexture.TryGetValue(name, out Texture texture); if (texture == null) { if (MbAsyncLoadAssets == null) { var go = GameObject.Find("Launch"); MbAsyncLoadAssets = go.GetComponent <MbAsyncLoadAssets>(); } MbAsyncLoadAssets.LocalLoadTextureFromAbAsync(path, name, call_back); } else { call_back(texture); } }