本文整理汇总了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);
}
}
}