Пример #1
0
        public static byte[] readAssetLuaFile(string path, bool encode = false)
        {
            WWW www = new WWW(path);

            while (!www.isDone)
            {
                System.Threading.Thread.Sleep(10);                //比较hacker的做法
                continue;
            }

            if (!string.IsNullOrEmpty(www.error))
            {
                Debug.LogError("no such file:" + path);
                return(null);
            }
            byte[] bytes = www.bytes;
            if (encode)
            {
                Crypt.UnCrypt(bytes, ENCODESTRING);
            }
            return(bytes);
        }