コード例 #1
0
    public int Port;    // 服务器port

    public void fromData(ByteArr byteArr)
    {
        ID   = byteArr.readInt();
        Name = byteArr.readString();
        Ip   = byteArr.readString();
        Port = byteArr.readInt();
    }
コード例 #2
0
    public string RoatVect; // 摄像机旋转角

    public void fromData(ByteArr byteArr)
    {
        ID       = byteArr.readInt();
        Name     = byteArr.readString();
        Eqpid    = byteArr.readInt();
        DataType = byteArr.readString();
        Unit     = byteArr.readString();
        Tag      = byteArr.readString();
        MinVal   = byteArr.readInt();
        MaxVal   = byteArr.readInt();
        PosVect  = byteArr.readString();
        RoatVect = byteArr.readString();
    }
コード例 #3
0
ファイル: DataLoad.cs プロジェクト: maokeuncle/BaseUnityFrame
    public static IEnumerator Load()
    {
        string          path       = $"{Application.streamingAssetsPath}/data/data.bytes";
        UnityWebRequest webRequest = UnityWebRequest.Get(path);

        webRequest.SendWebRequest();

        while (!webRequest.isDone)
        {
            yield return(null);

            if (webRequest.error != null)
            {
                webRequest = UnityWebRequest.Get(path);
                webRequest.SendWebRequest();
            }
        }

        allDataBytes = new ByteArr(webRequest.downloadHandler.data);

        if (allDataBytes.stream.Length <= 0)
        {
            Debug.LogError("data is empty");
            yield break;
        }

        while (allDataBytes.stream.Length - allDataBytes.stream.Position > 64)
        {
            int pos      = (int)allDataBytes.stream.Position;
            int fileSize = allDataBytes.readInt();

            string fileName = allDataBytes.readString();
            allDataBytes.stream.Position  = pos + 64;
            FilePosMap[fileName]          = pos + 60;
            allDataBytes.stream.Position += fileSize;
        }
        yield return(null);
    }