Пример #1
0
        public bool Load(string filePath)
        {
            this.mFilePath = filePath;
            string content = XFile.ReadTextFile(this.mFilePath);

            this.mContents = XTableExchange.lua.StringToTable(XCSharp.EncodeUTF8(content));
            if (this.mContents == null)
            {
                this.mContents = new XTable();
            }
            return(true);
        }
Пример #2
0
        public static string ReadTextFromStreamingAssets(string location)
        {
            Debug.Log("Read text 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 text from StreamingAssets failed. location=" + location);
                    Debug.LogError(www.error);
                    return("");
                }
                return(www.text);
            }

            return(XFile.ReadTextFile(location));
        }