mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 19:10:32 +00:00
perf: SceneMessage is now a value type (#989)
This commit is contained in:
parent
f99e71ebdf
commit
407b36acb7
@ -179,20 +179,20 @@ public void Deserialize(NetworkReader reader) { }
|
|||||||
public void Serialize(NetworkWriter writer) { }
|
public void Serialize(NetworkWriter writer) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SceneMessage : MessageBase
|
public struct SceneMessage : IMessageBase
|
||||||
{
|
{
|
||||||
public string sceneName;
|
public string sceneName;
|
||||||
public LoadSceneMode sceneMode; // Single = 0, Additive = 1
|
public LoadSceneMode sceneMode; // Single = 0, Additive = 1
|
||||||
public LocalPhysicsMode physicsMode; // None = 0, Physics3D = 1, Physics2D = 2
|
public LocalPhysicsMode physicsMode; // None = 0, Physics3D = 1, Physics2D = 2
|
||||||
|
|
||||||
public override void Deserialize(NetworkReader reader)
|
public void Deserialize(NetworkReader reader)
|
||||||
{
|
{
|
||||||
sceneName = reader.ReadString();
|
sceneName = reader.ReadString();
|
||||||
sceneMode = (LoadSceneMode)reader.ReadByte();
|
sceneMode = (LoadSceneMode)reader.ReadByte();
|
||||||
physicsMode = (LocalPhysicsMode)reader.ReadByte();
|
physicsMode = (LocalPhysicsMode)reader.ReadByte();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize(NetworkWriter writer)
|
public void Serialize(NetworkWriter writer)
|
||||||
{
|
{
|
||||||
writer.WriteString(sceneName);
|
writer.WriteString(sceneName);
|
||||||
writer.WriteByte((byte)sceneMode);
|
writer.WriteByte((byte)sceneMode);
|
||||||
|
Loading…
Reference in New Issue
Block a user