Пример #1
0
    public void SendHoloPacket(int port, HoloType type, HoloID id, string data)
    {
#if UNITY_WSA_10_0 && !UNITY_EDITOR
        SendMessage(UnityEngine.JsonUtility.ToJson(new HoloPacket(type, id, data)), port);
        //SendMessage("123456789123456789123456789123456789000", port);
#else
        //udp.Send(new byte[] { 1, 2, 3, 4, 5 }, 5);
        string pktstr = UnityEngine.JsonUtility.ToJson(new HoloPacket(type, id, data));
        udp.Send(Encoding.UTF8.GetBytes(pktstr), Encoding.UTF8.GetByteCount(pktstr), ep);
#endif
    }
Пример #2
0
    static string GetSaveFileName(HoloID id)
    {
#if UNITY_WSA_10_0 && !UNITY_EDITOR
        //Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
        Windows.Storage.StorageFolder localFolder = Windows.Storage.ApplicationData.Current.RoamingFolder;
        string path = Path.Combine(localFolder.Path, id.ToString() + "Save.save");
        Debug.Log("Savename " + path);
        return(path);
#else
        return(Path.Combine(Application.persistentDataPath, id.ToString() + "Save.save"));
#endif
    }
Пример #3
0
    HoloTransform LoadProjectorTransform(HoloID proj)
    {
        HoloTransform projTr = null;

        if (System.IO.File.Exists(GetSaveFileName(ProjectorID)))
        {
            projTr = UnityEngine.JsonUtility.FromJson <HoloTransform>(System.IO.File.ReadAllText(GetSaveFileName(ProjectorID)));
            //Debug.Log("Load  " + GetSaveFileName(ProjectorID));
        }
        else
        {
            //Debug.Log("Load unable to find " + GetSaveFileName(ProjectorID));
        }
        return(projTr);
    }
Пример #4
0
 public HoloPacket(HoloType type_, HoloID id_, string data_)
 {
     this.type = type_; this.id = id_; this.data = data_;
 }