当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReader.ReadByte2方法代码示例

本文整理汇总了C#中BinaryReader.ReadByte2方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadByte2方法的具体用法?C# BinaryReader.ReadByte2怎么用?C# BinaryReader.ReadByte2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryReader的用法示例。


在下文中一共展示了BinaryReader.ReadByte2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadMap


//.........这里部分代码省略.........
                        go = GameObject.CreatePrimitive(PrimitiveType.Cube);

                    }
                    else if (modelLib.dict.ContainsKey(readString) && modelLib.dict[readString].gameObj != null)
                    {
                        ModelFile modelFile = modelLib.dict[readString];
                        var gameObj = modelFile.gameObj;
                        modelFile.usedCount++;
                        go = (GameObject)Instantiate(gameObj);
                        go.name = gameObj.name;
                    }
                    else
                    {
                        go = GameObject.CreatePrimitive(PrimitiveType.Cube);
                        Debug.LogWarning(readString + " not found ");
                    }
                    go.name = readString;
                    modelObject = InitModel(go, readString);
                    modelObject.transform.position = ms.ReadVector();
                    modelObject.transform.eulerAngles = ms.ReadVector();
                    modelObject.transform.localScale = ms.ReadVector();

                    //if (!cells.Add(new KeyValuePair<Vector3, string>(g.pos, go.name)))
                    //{
                    //    Debug.Log("Destroy duplicate " + go.name, go);
                    //    Debug.Log("with " + go.name, go);
                    //    if (ingame)
                    //    Destroy(go);
                    //}
                }
                if (P == LevelPackets.FlyingModel && modelObject != null)
                    modelObject.flying = true;
                if (P == LevelPackets.roadtype)
                    spline.roadType = (RoadType)ms.ReadByte2();
                if (P == LevelPackets.Wall)
                    spline.wallTexture = true;
                if (P == LevelPackets.shapeMaterial)
                {
                    string readString = ms.ReadString();
                    spline.thumb = new Thumbnail() { url = Regex.Replace(readString, @"https?://server.critical-missions.com/tm/|https?://tmrace.net/tm/", "") };
                    //Debug.LogWarning(readString);
                }
                if (P == LevelPackets.textureTile)
                    spline.thumb.material.mainTextureScale = ms.ReadVector();
                if (P == LevelPackets.AntiFly)
                {
                    _GameSettings.gravitationAntiFly = ms.ReadFloat();
                    _GameSettings.gravitationFactor = ms.ReadFloat();
                }
                if (P == LevelPackets.Flying)
                    segment.flying = ms.ReadBool();

                if (P == LevelPackets.heightOffset)
                    spline.heightOffset = ms.ReadFloat();
                if (P == LevelPackets.Version)
                {
                    version = ms.ReadInt();
                    if (version >= 702)
                    {
                        foreach (var a in shapes.ToArray())
                        {
                            print("removing default brush " + a.name);
                            Destroy(a.gameObject);
                        }
                    }
                }
开发者ID:friuns,项目名称:New-Unity-Project-tm2---Copy,代码行数:67,代码来源:MapLoader.cs


注:本文中的BinaryReader.ReadByte2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。