Unity Easy Save Simple and practical

Source: Internet
Author: User

Easy Save uses:

1. Save Game Progress
2. Design game level (monster number, coordinates, background map, etc.)

Easy Save default storage address:

C:\Users\Administrator\AppData\LocalLow\DefaultCompany\ Project Name

Easy Save Format: (Cannot save the custom class directly)

http://moodkie.com/easysave/documentation/supported-types/(common format saved)

Unity Path:

Application.datapath; Current Project Asset Path
Application.streamingassetspath; Current Project Asset Path \streamingassets folder
Application.persistentdatapath; Persistent database path
Application.temporarycachepath; Temporary cache path

Simple Save:

usingUnityengine;usingSystem.Collections;usingSystem.Collections.Generic; Public classEasysavedemo1:monobehaviour { PublicStudent Student; voidOngui () {if(GUI. Button (NewRect (0,0, -, -),"Save") {Student Student=NewStudent (); Student.name="plates"; Student.age= -; Student.height=1.9f; Student.marriage=false; List<Student> list =NewList<student>(); //es2settings set = new Es2settings (Application.datapath + "Myfile3.text"); //Set.encrypt = false; //Set.encryptionpassword = "*";            stringPath = Application.datapath +"/level. Text"; //It's not going to throw an exception without saving.              //save multiple values to the same fileES2. Save (student.name, Path +"? tag=name"); ES2. Save (student.age, Path+"? tag=age"); ES2. Save (student.height, Path+"? tag=height"); ES2. Save (student.marriage, Path+"? tag=marriage"); }        if(GUI. Button (NewRect ( -,0, -, -),"Read"))        {            stringPath = Application.datapath +"/level. Text"; Student=NewStudent (); Student.name= ES2. load<string> (Path +"? tag=name"); Student.height= ES2. load<float> (Path +"? tag=height"); Student.age= ES2. load<int> (Path +"? tag=age"); Student.marriage= ES2. load<BOOL> (Path +"? tag=marriage"); }        if( This. student! =NULL) {GUI. Label (NewRect (0, -, -, -),"Name:"+student.name); Gui. Label (NewRect (0, Max, -, -),"Height:"+student.height); Gui. Label (NewRect (0, the, -, -),"Age:"+student.age); Gui. Label (NewRect (0, About, -, -),"Marriage:"+student.marriage); }    }    } Public classStudent { Public stringname;  Public intAge ;  Public floatheight;  Public BOOLmarriage;}

Unity Easy Save simple and practical

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.