Beispiel #1
0
    // 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();
    }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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;
 }
Beispiel #4
0
    // 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();
    }