mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax
This commit is contained in:
parent
a34b974580
commit
1b6ab9d7c0
@ -9,10 +9,8 @@ class ClientRpcBehaviour : NetworkBehaviour
|
||||
public event Action<int> onSendInt;
|
||||
|
||||
[ClientRpc]
|
||||
public void SendInt(int someInt)
|
||||
{
|
||||
public void SendInt(int someInt) =>
|
||||
onSendInt?.Invoke(someInt);
|
||||
}
|
||||
}
|
||||
|
||||
class ExcludeOwnerBehaviour : NetworkBehaviour
|
||||
@ -20,10 +18,8 @@ class ExcludeOwnerBehaviour : NetworkBehaviour
|
||||
public event Action<int> onSendInt;
|
||||
|
||||
[ClientRpc(includeOwner = false)]
|
||||
public void RpcSendInt(int someInt)
|
||||
{
|
||||
public void RpcSendInt(int someInt) =>
|
||||
onSendInt?.Invoke(someInt);
|
||||
}
|
||||
}
|
||||
|
||||
class AbstractNetworkBehaviourClientRpcBehaviour : NetworkBehaviour
|
||||
@ -35,27 +31,19 @@ public abstract class MockMonsterBase : NetworkBehaviour
|
||||
|
||||
public class MockZombie : MockMonsterBase
|
||||
{
|
||||
public override string GetName()
|
||||
{
|
||||
return "Zombie";
|
||||
}
|
||||
public override string GetName() => "Zombie";
|
||||
}
|
||||
|
||||
public class MockWolf : MockMonsterBase
|
||||
{
|
||||
public override string GetName()
|
||||
{
|
||||
return "Wolf";
|
||||
}
|
||||
public override string GetName() => "Wolf";
|
||||
}
|
||||
|
||||
public event Action<MockMonsterBase> onSendMonsterBase;
|
||||
|
||||
[ClientRpc]
|
||||
public void RpcSendMonster(MockMonsterBase someMonster)
|
||||
{
|
||||
public void RpcSendMonster(MockMonsterBase someMonster) =>
|
||||
onSendMonsterBase?.Invoke(someMonster);
|
||||
}
|
||||
}
|
||||
|
||||
public class ClientRpcTest : RemoteTestBase
|
||||
|
Loading…
Reference in New Issue
Block a user