Class IntegerMessage
A utility class to send simple network messages that only contain an integer.
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.NetworkSystem;
public class Test
{
void SendValue(int value)
{
var msg = new IntegerMessage(value);
NetworkServer.SendToAll(MsgType.Scene, msg);
}
}
Inheritance
IntegerMessage
Syntax
[Obsolete("The high level API classes are deprecated and will be removed in the future.")]
public class IntegerMessage : MessageBase
Constructors
IntegerMessage()
Declaration
IntegerMessage(Int32)
Declaration
public IntegerMessage(int v)
Parameters
Type |
Name |
Description |
Int32 |
v |
|
Fields
value
The integer value to serialize.
Declaration
Field Value
Methods
Deserialize(NetworkReader)
Declaration
public override void Deserialize(NetworkReader reader)
Parameters
Overrides
Serialize(NetworkWriter)
Declaration
public override void Serialize(NetworkWriter writer)
Parameters
Overrides