예제 #1
0
        public static byte[] ReadBytesFromStreamingAssets(string location)
        {
            Debug.Log("Read bytes from StreamingAssets : " + location);
            location = string.Format("{0}/{1}", Application.streamingAssetsPath, location);
            if (Application.platform == RuntimePlatform.Android)
            {
                WWW www = new WWW(location);
                while (!www.isDone)
                {
                    ;
                }
                if (!string.IsNullOrEmpty(www.error))
                {
                    Debug.LogError("Read bytes from StreamingAssets failed. location=" + location);
                    Debug.LogError(www.error);
                    return(null);
                }
                return(www.bytes);
            }

            return(XFile.ReadBytesFile(location));
        }
예제 #2
0
        public void Save()
        {
            string content = XTableExchange.lua.TableToString(this.mContents);

            XFile.WriteTextFile(this.mFilePath, content);
        }