Exemplo n.º 1
0
        private static void innerLoad(string path, MonoBehaviour parent, MyActionTwo action = null, bool isSave = false, loadType type = loadType.None)
        {
            loadNode node;

            node.path   = path;
            node.parent = parent;
            node.action = action;
            node.isSave = isSave;
            node.type   = type;
            paths.Enqueue(node);
            LoadFactory.NextLoad();
        }
Exemplo n.º 2
0
        static IEnumerator DownLoad(loadNode node)
        {
            LoadFactory.loadText = node.path;
            LoadFactory.www      = new WWW(node.path);
            yield return(LoadFactory.www);

            if (string.IsNullOrEmpty(LoadFactory.www.error))
            {
                loadType type = node.type;
                switch (type)
                {
                case loadType.Wwwbytes:
                    LoadFactory.ParseObject(node, LoadFactory.www.bytes);
                    break;

                case loadType.AssetBundle:
                    LoadFactory.ParseObject(node, LoadFactory.www.assetBundle);
                    break;

                case loadType.Texture:
                    LoadFactory.ParseObject(node, LoadFactory.www.texture);
                    break;

                case loadType.Text:
                    LoadFactory.ParseObject(node, LoadFactory.www.text);
                    break;

                case loadType.Xml:
                    LoadFactory.ParseXML(node, LoadFactory.www.text);
                    break;

                case loadType.AudioClip:
                    LoadFactory.ParseObject(node, LoadFactory.www.GetAudioClip());
                    break;
                }
                //LoadFactory.www = null;
                //Debug.Log("loadFactory.www>>>>>>>>>>>>>>>  ");
                LoadFactory.loadText = "加载完成";
                LoadFactory.NextLoad();
            }
            else
            {
                // LoadFactory.www = null;
                LoadFactory.loadText += " - 加载出错:" + www.error;
                Debug.Log("加载出错: " + www.error);
                LoadFactory.NextLoad();
            }
        }
Exemplo n.º 3
0
 public static LoadFactory LoadAsset(string[] path, MonoBehaviour parent, MyActionTwo action = null, bool isSave = false, loadType type = loadType.None)
 {
     LoadFactory.innerLoad(path, parent, action, isSave, type);
     return(instance);
 }
Exemplo n.º 4
0
 public static LoadFactory LoadAssetTextrue(string path, MonoBehaviour parent, MyActionTwo action = null, bool isSave = false)
 {
     LoadFactory.innerLoad(path, parent, action, isSave, loadType.Texture);
     return(instance);
 }
Exemplo n.º 5
0
 public static LoadFactory LoadAssetBundle(string[] path, MonoBehaviour parent, MyAction <object> action = null, bool isSave = false)
 {
     LoadFactory.innerLoad(path, parent, action, isSave, loadType.AssetBundle);
     return(instance);
 }