Esempio n. 1
0
 static int SetWWWObject(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Launch.Resource obj  = (Launch.Resource)ToLua.CheckObject(L, 1, typeof(Launch.Resource));
         UnityEngine.WWW arg0 = (UnityEngine.WWW)ToLua.CheckObject(L, 2, typeof(UnityEngine.WWW));
         obj.SetWWWObject(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
        IEnumerator LoadWWWResource(Resource res)
        {
            string url = GetInResPath(res);

            using (WWW www = new WWW(url))
            {
                yield return(www);

                res.isDone = true;
                if (string.IsNullOrEmpty(www.error))
                {
                    res.SetWWWObject(www);
                }
                else
                {
                    res.errorTxt = www.error;
                    CLog.LogError("Load resource [" + url + "] fail!");
                }
            }
            OnDone(res);
        }