Esempio n. 1
0
        /**
         * 载入资源,最后通过映射返回asset对象
         * */
        private IEnumerator loaderAssetBundles()
        {
            ABLoaderStruct[] loaderList = getLoaderABNames();
            for (int i = 0; i < loaderList.Length; i++)
            {
                // 加载ab到内存
                ABLoaderStruct abs = loaderList[i];
                AssetBundleManager.Instance.Load(abs.path, (a) =>
                {
                    GameObject go = a.Instantiate();
                    gameObjects.Add(abs.path, go);
                });
            }
            yield return(null);

            initMediator = false;
            // 资源载入完成后的处理操作
            int Length = commandList.Count;

            if (Length > 0)
            {
                for (int i = 0; i < Length; i++)
                {
                    CommandStruct cs = commandList[i];
                    Execute(cs.command, cs.value);
                }
                commandList.Clear();
            }
            input = true;
        }
Esempio n. 2
0
 /**
  * 预执行
  * */
 public void PreExecute(string command, Dictionary <string, System.Object> value)
 {
     if (initMediator)
     {
         CommandStruct cs = new CommandStruct();
         cs.command = command;
         cs.value   = value;
         commandList.Add(cs);
     }
     else
     {
         Execute(command, value);
     }
 }