예제 #1
0
 internal void LoadFromFile(string path, string key, string ext, ResourceSource resType, ResourceManager.OnGetResource callback,
                            bool decode)
 {
     //Debug.Log("LoadFromFile " + path + " + " + key + " + " + ext);
     //Debug.Log(Enum.GetName(typeof (ResourceSource), resType));
     _callback = callback;
     _key      = key;
     _decode   = decode;
     StartCoroutine(WaitLoadResource(string.Format("{0}{1}/{2}.{3}", ResourceProtocol.File, path, _key, ext),
                                     resType, null));
 }
예제 #2
0
        /*/// <summary>
         * ///
         * /// </summary>
         * /// <param name="path">langiage,icons,sound,music...</param>
         * /// <param name="key">name of file</param>
         * /// <param name="ext">ogg,png,jpg...</param>
         * /// <param name="resType">movie,audioclip,texture... for www</param>
         * /// <param name="callback">callback</param>
         * internal void LoadResource(string path, string key, string ext, ResourceSource resType, ResourceManager.OnGetResource callback)
         * {
         *
         * }
         *
         * internal void LoadResource(string path, string key, string ext, ResourceSource resType, ResourceManager.OnGetResource callback,
         *      bool decode)
         * {
         *      //LoadResource(path, key, ext, resType, callback, decode,null, null);
         *
         *      //Debug.Log(Enum.GetName(typeof (ResourceSource), resType));
         *      /*_callback = callback;
         *      _key = key;
         *      _decode = decode;
         *      _type = resType;
         *      StartCoroutine(
         *                      WaitLoadLocalResource(
         *                                      "file://" + path.Replace("http://", "").Replace("https://", "").Replace(":", "") + "/" + _key +  ext,
         *                                      resType, null, null));
         * }
         *
         * internal void LoadResource(string protocol, string path, string key, string ext, ResourceSource resType, ResourceManager.OnGetResource callback,
         *      bool decode,Hashtable post, Hashtable gets)
         * {
         *      //Debug.Log(Enum.GetName(typeof (ResourceSource), resType));
         *      _callback = callback;
         *      _key = key;
         *      _decode = decode;
         *      _type = resType;
         *      _getTable = gets;
         *      StartCoroutine(
         *                      WaitLoadResource(protocol+"/"+path + "/" + _key + ext,
         *                                                                      resType, post));
         * }*/

        /*internal void LoadFromUrl(string url, string key, ResourceSource resType, ResourceManager.OnGetResource callback,
         *      bool decode, Hashtable post, Hashtable gets)
         * {
         *      //Debug.Log(Enum.GetName(typeof (ResourceSource), resType));
         *      //Debug.Log("LoadFromUrl " + url+" : " + key);
         *      _callback = callback;
         *      _key = key;
         *      _decode = decode;
         *      _type = resType;
         *      _getTable = gets;
         *      StartCoroutine(WaitLoadResource(url,resType, post));
         * }*/

        internal void LoadFromFile(string path, string key, string ext, ResourceType resPath, ResourceManager.OnGetResource callback, bool decode, ResourceType resourceType)
        {
            if (Gateway.Debug)
            {
                /*Debug.Log("LoadFromFile " + path + "/" + key + "." + ext);
                 * Debug.Log("Resource path : "+Enum.GetName(typeof(ResourceType), resPath));
                 * Debug.Log("Resource type : " + Enum.GetName(typeof(ResourceType), resourceType));*/
            }

            _callback     = callback;
            _key          = key;
            _decode       = decode;
            _resourceType = resourceType;
            StartCoroutine(WaitLoadResources(string.Format("{0}{1}/{2}.{3}", ResourceProtocol.File, path, _key, ext),
                                             resourceType, null));
        }
예제 #3
0
 internal void LoadFromGateway(ResourceSource path, string key, string extension, ResourceSource resType, ResourceManager.OnGetResource callback)
 {
     if (Gateway.Debug)
     {
         ULog.Log(string.Format("LoadFromGateway ResourceSource: {0}  path: {1} , key {2} , ext: {3}", Enum.GetName(typeof(ResourceSource), resType), path, key, extension));
     }
     //Debug.Log(Enum.GetName(typeof (ResourceSource), resType));
     _callback = callback;
     _key      = key;
     _decode   = true;
     if (_loader == null)
     {
         _loader = Gateway.GetSender();
     }
     _loader.Call(
         ResourceManager.serverClassName, ResourceManager.resourceLoadMethod,
         new Hashtable {
         { "path", path },
         { "key", _key },
         { "type", resType },
         { "ext", extension }
     }, OnGetResources);
 }