示例#1
0
        //---------------------------------------------------------------------
        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);
            }
        }
示例#2
0
        //---------------------------------------------------------------------
        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>();
        }
示例#3
0
        //---------------------------------------------------------------------
        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);
            }
        }