public void load()
    {
        if (File.Exists(Application.persistentDataPath + "\\savedState.gd"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "\\savedState.gd", FileMode.Open);
            annotations = (List <annotationSerializer>)bf.Deserialize(file);
            file.Close();

            for (int i = 0; i < annotations.Count; i++)
            {
                annotationSerializer a = annotations [i];
                loadAnnoatation(a.flagX, a.flagY, a.flagZ, a.flagRotX, a.flagRotY, a.flagRotZ, a.flagRotW, a.pinX, a.pinY, a.pinZ, a.modelID, a.text);
            }
        }

        //Debug.Log(ms[0].annotations[0] + "out");
    }
Example #2
0
    public annotationSerializer serialize()
    {
        annotationSerializer ret = new annotationSerializer();

        ret.pinX     = pin.transform.localPosition.x;
        ret.pinY     = pin.transform.localPosition.y;
        ret.pinZ     = pin.transform.localPosition.z;
        ret.flagX    = transform.localPosition.x;
        ret.flagY    = transform.localPosition.y;
        ret.flagZ    = transform.localPosition.z;
        ret.flagRotX = transform.localRotation.x;
        ret.flagRotY = transform.localRotation.y;
        ret.flagRotZ = transform.localRotation.z;
        ret.flagRotW = transform.localRotation.w;
        ret.text     = text.GetComponent <Text> ().text;
        ret.modelID  = modelID;

        return(ret);
    }