本文整理汇总了C#中NetworkReader.ReadBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# NetworkReader.ReadBoolean方法的具体用法?C# NetworkReader.ReadBoolean怎么用?C# NetworkReader.ReadBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NetworkReader
的用法示例。
在下文中一共展示了NetworkReader.ReadBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.connectionId = (int) reader.ReadPackedUInt32();
this.address = reader.ReadString();
this.port = (int) reader.ReadPackedUInt32();
this.isHost = reader.ReadBoolean();
this.isYou = reader.ReadBoolean();
}
示例2: ClientVC
public ClientVC(NetworkReader nr)
: base(new Vec2i(0,0), 0)
{
this.data = new VesselTile[VesselChunk.DATA_COUNT];
index.x = nr.ReadInt32();
index.y = nr.ReadInt32();
version = nr.ReadUInt32();
tileCount = nr.ReadInt32();
for (int i = 0; i < tileCount; i++) {
//read in vessel tile
Vec2i tileI;
tileI.x = nr.ReadInt32();
tileI.y = nr.ReadInt32();
FloorType floor0 = (FloorType)nr.ReadByte();
FloorType floor1 = (FloorType)nr.ReadByte();
WallTypeMask wallMask = (WallTypeMask)nr.ReadByte();
bool wallNode = nr.ReadBoolean();
VesselTile tile = new VesselTile(wallMask, wallNode, floor0, floor1, (uint)VesselTile.FLAGS.NONE);
SetTile(tileI, tile);
}
}
示例3: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.netId = reader.ReadNetworkId();
this.payload = reader.ReadBytesAndSize();
this.teleport = reader.ReadBoolean();
this.time = (int) reader.ReadPackedUInt32();
}
示例4: OnDeserialize
public override void OnDeserialize(NetworkReader reader, bool initialState)
{
if (reader.ReadPackedUInt32() != 0)
{
this.m_Slot = reader.ReadByte();
this.m_ReadyToBegin = reader.ReadBoolean();
}
}
示例5: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.connectionId = (int) reader.ReadPackedUInt32();
this.address = reader.ReadString();
this.port = (int) reader.ReadPackedUInt32();
this.isHost = reader.ReadBoolean();
this.isYou = reader.ReadBoolean();
uint num = reader.ReadPackedUInt32();
if (num <= 0U)
return;
List<PeerInfoPlayer> peerInfoPlayerList = new List<PeerInfoPlayer>();
for (uint index = 0; index < num; ++index)
{
PeerInfoPlayer peerInfoPlayer;
peerInfoPlayer.netId = reader.ReadNetworkId();
peerInfoPlayer.playerControllerId = (short) reader.ReadPackedUInt32();
peerInfoPlayerList.Add(peerInfoPlayer);
}
this.playerIds = peerInfoPlayerList.ToArray();
}
示例6: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.connectionId = (int) reader.ReadPackedUInt32();
this.address = reader.ReadString();
this.port = (int) reader.ReadPackedUInt32();
this.isHost = reader.ReadBoolean();
this.isYou = reader.ReadBoolean();
uint num = reader.ReadPackedUInt32();
if (num > 0)
{
List<PeerInfoPlayer> list = new List<PeerInfoPlayer>();
for (uint i = 0; i < num; i++)
{
PeerInfoPlayer player;
player.netId = reader.ReadNetworkId();
player.playerControllerId = (short) reader.ReadPackedUInt32();
list.Add(player);
}
this.playerIds = list.ToArray();
}
}
示例7: Deserialize
public override void Deserialize(NetworkReader reader) {
//Get the no of inputs received
int count = reader.ReadInt32();
//Prepaare list
if (inputsList != null) {
inputsList.Clear(); //Detatch prev elements
}
inputsList = new List<Inputs>(); //Detatch prev mem
//Build all inputs
for (int i = 0; i < count; i++){
//Create
Inputs input = new Inputs();
//Deserialize individually
input.crouch = reader.ReadBoolean();
input.jump = reader.ReadBoolean();
input.move = reader.ReadBoolean();
input.pitch = reader.ReadSingle();
input.rotate = reader.ReadBoolean();
input.timeStamp = reader.ReadDouble();
input.walk = reader.ReadBoolean();
bool[] wasd = new bool[4];
wasd[0] = reader.ReadBoolean();
wasd[1] = reader.ReadBoolean();
wasd[2] = reader.ReadBoolean();
wasd[3] = reader.ReadBoolean();
input.wasd = wasd;
input.yaw = reader.ReadSingle();
//Add to the message list
inputsList.Add(input);
//Check if is the last input and register stamp
if(i == count - 1) {
stamp = input.timeStamp;
}
}
}
示例8: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.netId = reader.ReadNetworkId();
this.authority = reader.ReadBoolean();
}
示例9: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.slotId = reader.ReadByte();
this.readyState = reader.ReadBoolean();
}
示例10: ReadParameters
private void ReadParameters(NetworkReader reader, bool autoSend)
{
for (int i = 0; i < this.m_Animator.parameters.Length; i++)
{
if (!autoSend || this.GetParameterAutoSend(i))
{
AnimatorControllerParameter parameter = this.m_Animator.parameters[i];
if (parameter.type == AnimatorControllerParameterType.Int)
{
int num2 = (int) reader.ReadPackedUInt32();
this.m_Animator.SetInteger(parameter.nameHash, num2);
this.SetRecvTrackingParam(parameter.name + ":" + num2, i);
}
if (parameter.type == AnimatorControllerParameterType.Float)
{
float num3 = reader.ReadSingle();
this.m_Animator.SetFloat(parameter.nameHash, num3);
this.SetRecvTrackingParam(parameter.name + ":" + num3, i);
}
if (parameter.type == AnimatorControllerParameterType.Bool)
{
bool flag = reader.ReadBoolean();
this.m_Animator.SetBool(parameter.nameHash, flag);
this.SetRecvTrackingParam(parameter.name + ":" + flag, i);
}
}
}
}
示例11: ReadParameters
private void ReadParameters(NetworkReader reader, bool autoSend)
{
for (int index = 0; index < this.m_Animator.parameters.Length; ++index)
{
if (!autoSend || this.GetParameterAutoSend(index))
{
AnimatorControllerParameter parameter = this.m_Animator.parameters[index];
if (parameter.type == AnimatorControllerParameterType.Int)
{
int num = (int) reader.ReadPackedUInt32();
this.m_Animator.SetInteger(parameter.nameHash, num);
this.SetRecvTrackingParam(parameter.name + ":" + (object) num, index);
}
if (parameter.type == AnimatorControllerParameterType.Float)
{
float num = reader.ReadSingle();
this.m_Animator.SetFloat(parameter.nameHash, num);
this.SetRecvTrackingParam(parameter.name + ":" + (object) num, index);
}
if (parameter.type == AnimatorControllerParameterType.Bool)
{
bool flag = reader.ReadBoolean();
this.m_Animator.SetBool(parameter.nameHash, flag);
this.SetRecvTrackingParam(parameter.name + ":" + (object) flag, index);
}
}
}
}
示例12: Deserialize
public override void Deserialize(NetworkReader reader)
{
this.connectionId = (int) reader.ReadPackedUInt32();
this.netId = reader.ReadNetworkId();
this.authorityState = reader.ReadBoolean();
}
示例13: Deserialize
public override void Deserialize(NetworkReader reader)
{
Result = reader.ReadInt32();
JustDoIt = reader.ReadBoolean();
PlayerID = reader.ReadInt64();
}
示例14: ReceiveSetWall
private void ReceiveSetWall(NetworkReader reader)
{
byte tile = reader.ReadByte();
bool wall = reader.ReadBoolean();
if (hosting)
{
SendAll(SetWallMessage(tile, wall));
}
if (world.walls.Contains(tile) != wall)
{
audio.PlayOneShot(placeSound);
if (wall)
{
world.walls.Add(tile);
}
else
{
world.walls.Remove(tile);
}
}
worldView.RefreshWalls();
}
示例15: Deserialize
public override void Deserialize(NetworkReader reader)
{
name = reader.ReadString();
var isNull = reader.ReadBoolean();
if (isNull){
value = null;
return;
}
var typeName = reader.ReadString();
var t = System.Type.GetType(typeName);
if (t == typeof(string)){
value = reader.ReadString();
return;
}
if (t == typeof(bool)){
value = reader.ReadBoolean();
return;
}
if (t == typeof(int)){
value = reader.ReadInt32();
return;
}
if (t == typeof(float)){
value = reader.ReadSingle();
return;
}
if (t == typeof(Color)){
value = reader.ReadColor();
return;
}
if (t == typeof(Vector2)){
value = reader.ReadVector2();
return;
}
if (t == typeof(Vector3)){
value = reader.ReadVector3();
return;
}
if (t == typeof(Vector4)){
value = reader.ReadVector4();
return;
}
if (t == typeof(Quaternion)){
value = reader.ReadQuaternion();
return;
}
if (t == typeof(GameObject)){
value = reader.ReadGameObject();
return;
}
if (typeof(Component).RTIsAssignableFrom(t)){
var go = reader.ReadGameObject();
if (go != null){
value = go.GetComponent(t);
}
return;
}
}