// Use this for initialization void Start() { plane = this.gameObject.GetComponent <ProceduralPlane>(); //keystone = new KeystoneOffset(); // LOAD keystone = KeystoneOffset.Load(); // apply stored (serialized) offsets plane.topLeftOffset = keystone.TopLeftOffset; plane.topRightOffset = keystone.TopRightOffset; plane.bottomLeftOffset = keystone.BottomLeftOffset; plane.bottomRightOffset = keystone.BottomRightOffset; plane.Rebuild(); }
public static KeystoneOffset Load() { Debug.Log("path = " + Application.persistentDataPath + FILENAME); KeystoneOffset keystone = new KeystoneOffset(); if (File.Exists(Application.persistentDataPath + FILENAME)) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + FILENAME, FileMode.Open); keystone = (KeystoneOffset)bf.Deserialize(file); file.Close(); Debug.Log("Keystone loaded"); } return(keystone); }
public static KeystoneOffset Load() { Debug.Log("path = " + Application.persistentDataPath + FILENAME); KeystoneOffset keystone = new KeystoneOffset(); if(File.Exists(Application.persistentDataPath + FILENAME)) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + FILENAME, FileMode.Open); keystone = (KeystoneOffset)bf.Deserialize(file); file.Close(); Debug.Log("Keystone loaded"); } return keystone; }
// Use this for initialization void Start() { plane = this.gameObject.GetComponent<ProceduralPlane>(); //keystone = new KeystoneOffset(); // LOAD keystone = KeystoneOffset.Load(); // apply stored (serialized) offsets plane.topLeftOffset = keystone.TopLeftOffset; plane.topRightOffset = keystone.TopRightOffset; plane.bottomLeftOffset = keystone.BottomLeftOffset; plane.bottomRightOffset = keystone.BottomRightOffset; plane.Rebuild(); }