ایجاد فایل متنی در یونیتی_خواندن از فایل متنی در یونتیی_نوشتن در فایل متنی در یونیتی
يكشنبه, ۲۰ دی ۱۳۹۴، ۱۲:۱۸ ب.ظ
منبع:gameover.blog.ir
http://answers.unity3d.com/questions/813752/is-there-any-way-to-save-a-variable-into-a-txt-fil.html
http://answers.unity3d.com/questions/813752/is-there-any-way-to-save-a-variable-into-a-txt-fil.html
using UnityEngine; using UnityEngine.UI; using System.Collections; using System.IO; public class BestScore2 : MonoBehaviour { public Text textBestScore; // you dont need this void Start () { string t = "your text"; string path = "Builds/FormulaOne_Data/BestScore.txt"; System.IO.File.WriteAllText (@path, t); // for writing string text = System.IO.File.ReadAllText(@path); // for reading textBestScore.text = text; // you dont need this } }
۹۴/۱۰/۲۰