Last active
November 23, 2015 16:14
-
-
Save nirleka/4c21087697d57140b908 to your computer and use it in GitHub Desktop.
Unity Vexe framework Fast Save to File Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using UnityEngine; | |
using Vexe.FastSave; | |
using Vexe.Runtime.Types; | |
namespace FSExamples | |
{ | |
public class GameObjectTest : BaseBehaviour | |
{ | |
public GameObject target; | |
[HideInInspector] | |
public string output; | |
[Show] void SaveGo() | |
{ | |
output = Save.GameObjectToMemory(target).GetString(); | |
} | |
[Show] void LoadIntoNewGo() | |
{ | |
Load.GameObjectFromMemory(output.GetBytes(), new GameObject()); | |
} | |
[Show] void LoadIntoTargetGo() | |
{ | |
target.LoadFromMemory(output.GetBytes()); | |
} | |
[Show] void SaveToFile() | |
{ | |
Save.GameObjectToFile( | |
//akan disimpan di Assets/dst... | |
//http://docs.unity3d.com/ScriptReference/Application-dataPath.html | |
//perisa script save & load buat liat lbh lanjut. | |
//ps. file bakal muncul kalo folder di refresh | |
Application.dataPath + "/VFW Examples/FastSave Examples/Save/test", | |
target | |
); | |
} | |
[Show] void LoadFromFile() | |
{ | |
Load.GameObjectFromFile( | |
//akan disimpan di Assets/dst... | |
Application.dataPath + "/VFW Examples/FastSave Examples/Save/test", | |
target | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment