当前位置: 首页 > news >正文

陕西网站建设排名黄骅港金沙滩门票价格

陕西网站建设排名,黄骅港金沙滩门票价格,湖南企业网络推广服务,网站备案 影响吗关于easySave2 easySave3保存数据的操作#xff1b;包含EasySave3运行报错的解决 /// 数据存储路径#xff08;Easy Save的默认储存位置为#xff1a;Application.persistentDataPath#xff0c;为了方便我们可以给它指定储存路径#xff09; #region 存储数据/*/// /// 存… 关于easySave2 easySave3保存数据的操作包含EasySave3运行报错的解决 /// 数据存储路径Easy Save的默认储存位置为Application.persistentDataPath为了方便我们可以给它指定储存路径 #region 存储数据/*/// /// 存储数据/// private void SaveData(){ES2.Save(123, dataPath IntData);ES2.Save(1.23f, dataPath FloatData);ES2.Save(true, dataPath BoolData);ES2.Save(abc, dataPath StringData);ES2.Save(new Vector3(10, 20, 30), dataPath Vector3Data);/// 存储transform GameObject go new GameObject();go.transform.localPosition new Vector3(10, 20, 30);go.transform.localScale new Vector3(3, 3, 3);ES2.Save(go.transform, dataPath TransformData);/// 存储数组int[] intArray new int[3] { 3, 2, 1 };ES2.Save(intArray, dataPath IntArrayData);/// 存储集合Liststring stringList new Liststring();stringList.Add(stringlist1);stringList.Add(stringlist2);stringList.Add(stringlist3);ES2.Save(stringList, dataPath StringListData);/// 存储字典Dictionaryint, string stringDict new Dictionaryint, string();stringDict.Add(1, a);stringDict.Add(2, b);ES2.Save(stringDict, dataPath StringDictData);/// 存储栈Stackstring stringStack new Stackstring();stringStack.Push(aaa);stringStack.Push(bbb);ES2.Save(stringStack, dataPath StringStackData);//保存图片 注意该图片原文件属性“Advanced Read/WriteEnable[*]”勾选可读写的// ES2.SaveImage(image.sprite.texture, MyImage.png);}*/#endregion#region 加载数据/*/// /// 加载数据/// private void LoadData(){int loadInt ES2.Loadint(dataPath IntData);Debug.Log(读取的int loadInt);float loadFloat ES2.Loadfloat(dataPath FloatData);Debug.Log(读取的float loadFloat);bool loadBool ES2.Loadbool(dataPath BoolData);Debug.Log(读取的bool loadBool);string loadString ES2.Loadstring(dataPath StringData);Debug.Log(读取的string loadString);Vector3 loadVector3 ES2.LoadVector3(dataPath Vector3Data);Debug.Log(读取的vector3 loadVector3);Transform loadTransform ES2.LoadTransform(dataPath TransformData);Debug.Log(读取的transform Position loadTransform.localPosition Scale loadTransform.localScale);/// 读取数组格式存储int[] loadIntArray ES2.LoadArrayint(dataPath IntArrayData);foreach (int i in loadIntArray){Debug.Log(读取的数组 i);}/// 读取集合格式存储Liststring loadStringList ES2.LoadListstring(dataPath StringListData);foreach (string s in loadStringList){Debug.Log(读取的集合数据 s);}/// 读取字典格式存储Dictionaryint, string loadStringDict ES2.LoadDictionaryint, string(dataPath StringDictData);foreach (var item in loadStringDict){Debug.Log(读取的字典数据 key item.Key value item.Value);}Stackstring loadStringStack ES2.LoadStackstring(dataPath StringStackData);foreach (string ss in loadStringStack){Debug.Log(读取的栈内数据 ss);}/// 读取纹理 注意该图片原文件属性“Advanced Read/WriteEnable[*]”勾选可读写的Texture2D tex ES2.LoadImage(MyImage.png);Sprite temp Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0, 0));// showImage.sprite temp;}*/#endregion#region 删除数据/*/// /// 删除数据/// private void DeleteData(){/// 判断是否有该存储keyif (ES2.Exists(dataPath IntData)){Debug.Log(ES2.Exists(dataPath IntData));/// 删除存储keyES2.Delete(dataPath IntData);}}*/#endregion#region GUI测试用的 UI按钮/*void OnGUI(){if (GUI.Button(new Rect(0, 0, 100, 100), 储存数据)){SaveData();}if (GUI.Button(new Rect(0, 100, 100, 100), 读取数据)){LoadData();}if (GUI.Button(new Rect(0, 200, 100, 100), 删除数据)){DeleteData();}}*/#endregion#region 保存到本地/保存到web/*public IEnumerator UploadMesh(Mesh mesh, string tag) {// Create a URL and add parameters to the end of it.string myURL http://www.server.com/ES2.php;myURL ?webfilenamemyFile.txtwebusernameuserwebpasswordpass;// Create our ES2Web object.ES2Web web new ES2Web(myURL tag tag);// Start uploading our data and wait for it to finish.yield return StartCoroutine(web.Upload(mesh));if (web.isError){// Enter your own code to handle errors here.Debug.LogError(web.errorCode : web.error);} }public IEnumerator DownloadMesh(string tag) {// Create a URL and add parameters to the end of it.string myURL http://www.server.com/ES2.php;myURL ?webfilenamemyFile.txtwebusernameuserwebpasswordpass;// Create our ES2Web object.ES2Web web new ES2Web(myURL tag tag);// Start downloading our data and wait for it to finish.yield return StartCoroutine(web.Download());if (web.isError){// Enter your own code to handle errors here.Debug.LogError(web.errorCode : web.error);}else{// We could save our data to a local file and load from that.web.SaveToFile(myFile.txt);// Or we could just load directly from the ES2Web object.this.GetComponentMeshFilter().mesh web.LoadMesh(tag);} }*/#endregion#region 最新版的easySave3运行会报错,按照以下修改即可:/** private void Start(){if (LoadEventLoadEvent.OnStartsettings!null){Load();}}*/#endregion#region 读取/保存 音频/*// Get the AudioSource we want to use to play our AudioClip.var source this.GetComponentAudioSource();// Load an AudioClip from the streaming assets folder into our source.source.clip ES3.LoadAudio(Application.streamingAssetsPath /AudioFile.wav);// Play the AudioClip we just loaded using our AudioSource.source.Play();// Get the AudioSource containing our AudioClip.var source this.GetComponentAudioSource();// Save an AudioClip in Easy Saves uncompressed format.ES3.SaveAudioClip(myAudio, source.clip);// Load the AudioClip back into the AudioSource and play it.source.clip ES3.LoadAudioClip(myAudio);source.Play();*/#endregion#region 从Resource加载/*文件必须具有扩展名 例如:.bytes以便能够从参考资料中加载它// Create an ES3Settings object to set the storage location to Resources.var settings new ES3Settings();settings.location ES3.Location.Resources;// Load from a file called myFile.bytes in Resources.var myValue ES3.LoadVector3(myFile.bytes, settings);// Load from a file called myFile.bytes in a subfolder of Resources.var myValue ES3.LoadVector3(myFolder/myFile.bytes);*/#endregion#region 把 一堆键值数据 保存为string/byte[]/*// Create a new ES3File, providing a false parameter.var es3file new ES3File(false);// Save your data to the ES3File.es3File.SaveTransform(myTransform, this.transform);es3File.Savestring(myName, myScript.name);// etc ...//保存为字符串string fileAsString es3File.LoadRawString();//保存为 字节数组byte[] fileAsByteArray es3File.LoadRawBytes().*/#endregion#region 从 字符串/byte[] 读取/** //把字节数组转换成参数// If were loading from a byte array, simply provide it as a parameter.var es3file new ES3File(fileAsByteArray, false);// 把字符串转换为参数// 如果我们以字符串的形式加载首先需要将其转换为字节数组再把字节数组转换为参数。var es3file new ES3File((new ES3Settings()).encoding.GetBytes(fileAsString), false);//再对应取出响应的值// Load the data from the ES3File.es3File.LoadIntoTransform(myTransform, this.transform);//取出该值赋值到自身myScript.name es3File.Loadstring(myName); //取出 name// etc ...*/#endregion#region 电子表格/*使用ES3Spreadsheet, Easy Save能够创建电子表格并以CSV格式存储所有流行的电子表格软件都支持这种格式包括 Excel、OSX数字和OpenOffice。保存:var sheet new ES3Spreadsheet();// Add data to cells in the spreadsheet.for(int col0; col10; col){for(int row0; row8; row){sheet.SetCellstring(col, row, someData);}}sheet.Save(mySheet.csv);*//*如果要将数据追加到现有的电子表格请将电子表格的追加变量设置为true。电子表格中的任何行都将被添加到保存到的行末尾。读取:// Create a blank ES3Spreadsheet.var sheet new ES3Spreadsheet();sheet.Load(spreadsheet.csv);// Output the first row of the spreadsheet to console.for(int col0; colsheet.ColumnCount; col)Debug.Log(sheet.GetCellint(col, 0));*/#endregion
http://www.dnsts.com.cn/news/270669.html

相关文章:

  • 代做效果图的网站好中信建设有限责任公司内江分公司
  • 丹阳高铁站对面的规划买过域名之前就可以做网站了吗
  • 珠海网站建设网沈阳市建设工程项目管理中心
  • 怀柔富阳网站建设摄影图片素材网站
  • 金鹏建设集团网站做微信公众号微网站
  • 网站站长英语中国最大的网络公司是哪个
  • 自己公司网站设计wordpress编辑文字内容
  • 企业建站业务还能做吗整合网络营销策划
  • 网站标签怎样修改网站建设师要求
  • 怎么选择镇江网站建设wordpress 4.9.7 中文
  • 网站后台地址忘记了网站建设设计哪家好
  • 自助建设响应式网站直播交友app开发
  • 个人网站用移动硬盘做服务器天津做网站选津坤科技
  • 做网站的生产方式网站开发一般用的什么架构
  • 有好点的网站建设公司吗安徽网站备案要多少时间
  • 网站根目录权限设置山西seo排名厂家
  • 长沙做彩票网站公司宝应县天宇建设网站
  • 建网站平台安全性常州广告公司排名
  • 广东建设工程备案网站产品工业设计网站
  • 南宁做网站公司韩国网页设计欣赏
  • 江西省美丽乡村建设公布网站wordpress加速优化服务
  • 滁州建设局网站进出口贸易公司
  • 免费制作头像的网站盗版小说网站建设
  • 张家港网站制作企优网站如何判断做的好不好
  • 如何建个人网站流程seo推广有用吗
  • 后台管理网站建设桂林两江四湖属于哪个区
  • 做网站视频手机上海企业登记全程电子化服务平台
  • 网站建设检查整改情况报告做网站的前景如何
  • 做淘宝推广开网站合适php网站后台验证码不显示
  • 东莞门户网站建设东方商易网站开发