Esempio n. 1
0
    //==================================ANDROID==================================
    //Get the Headset Id and Endpoints and save to JSON
    void GetID_Android()
    {
        StreamReader inp_stm = new StreamReader(dataPath);

        while (!inp_stm.EndOfStream)
        {
            string inp_ln = inp_stm.ReadLine();
            //Debug.Log(inp_ln);
            Hdata  = JsonUtility.FromJson <ClassHeadset>(inp_ln);
            inp_ln = JsonUtility.ToJson(Hdata);
            string filePath;
            if (devModeAnd)
            {
                filePath = m_Path + Path.GetFullPath("Hdata.json");
            }
            else
            {
                filePath = pathA + "/Hdata.json";
            }
            File.WriteAllText(filePath, inp_ln);
        }
        inp_stm.Close();

        Headset        = Hdata.HeadsetID;
        myGetEndpoint  = Hdata.GetEndPoint;
        myPushEndpoint = Hdata.PostEndPoint;
    }
Esempio n. 2
0
    //==================================WINDOWS==================================
    //Get the Headset Id and Endpoints and save to JSON
    void GetID()
    {
        StreamReader inp_stm = new StreamReader(dataPath);

        while (!inp_stm.EndOfStream)                //read till end of file
        {
            string inp_ln = inp_stm.ReadLine();
            Hdata  = JsonUtility.FromJson <ClassHeadset>(inp_ln);
            inp_ln = JsonUtility.ToJson(Hdata);
            string filePath;
            if ((Application.platform == RuntimePlatform.WindowsPlayer) && (devModeWin))
            {
                HeadsetPath = "/Hdata.json";
                filePath    = Application.dataPath + HeadsetPath;
            }
            if ((Application.platform == RuntimePlatform.WindowsPlayer) && (devModeWin))
            {
                HeadsetPath = "/EVR/Hdata.json";
                filePath    = Application.dataPath + HeadsetPath;
            }
            else
            {
                HeadsetPath = pathW + "/Hdata.json";
                filePath    = HeadsetPath;
            }
            Debug.Log(filePath);
            File.WriteAllText(filePath, inp_ln);
        }
        inp_stm.Close();

        //save the read data from JSON
        Headset        = Hdata.HeadsetID;
        myGetEndpoint  = Hdata.GetEndPoint;
        myPushEndpoint = Hdata.PostEndPoint;
    }