mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
SyncVar Updates (#660)
* Change SyncVar hooks to use `nameof` I intentionally left the test for missing hook as a literal string because it won't compile otherwise. * Removed unnecessary property value set from hook
This commit is contained in:
parent
68f63b5f69
commit
d2868646fa
@ -61,7 +61,6 @@ public void CmdSendLevelLoaded()
|
|||||||
|
|
||||||
private void ReadyStateChanged(bool NewReadyState)
|
private void ReadyStateChanged(bool NewReadyState)
|
||||||
{
|
{
|
||||||
ReadyToBegin = NewReadyState;
|
|
||||||
OnClientReady(ReadyToBegin);
|
OnClientReady(ReadyToBegin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
class MySyncVar : NetworkBehaviour
|
class MySyncVar : NetworkBehaviour
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
class MySyncVar : ScriptableObject
|
class MySyncVar : ScriptableObject
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
[SyncVar]
|
[SyncVar]
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
class MySyncVar<T>
|
class MySyncVar<T>
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
interface MySyncVar
|
interface MySyncVar
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
[SyncVar] int var2;
|
[SyncVar] int var2;
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook = "OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
public void TakeDamage(int amount)
|
public void TakeDamage(int amount)
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
[SyncVar]
|
[SyncVar]
|
||||||
|
@ -15,7 +15,7 @@ public void OnDeserializeDelta(NetworkReader reader) {}
|
|||||||
|
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook = "OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
[SyncVar]
|
[SyncVar]
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook = "OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
public void TakeDamage(int amount)
|
public void TakeDamage(int amount)
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook="OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
[SyncVar] int var2;
|
[SyncVar] int var2;
|
||||||
|
@ -5,7 +5,7 @@ namespace MirrorTest
|
|||||||
{
|
{
|
||||||
class MirrorTestPlayer : NetworkBehaviour
|
class MirrorTestPlayer : NetworkBehaviour
|
||||||
{
|
{
|
||||||
[SyncVar(hook = "OnChangeHealth")]
|
[SyncVar(hook = nameof(OnChangeHealth))]
|
||||||
int health;
|
int health;
|
||||||
|
|
||||||
public void TakeDamage(int amount)
|
public void TakeDamage(int amount)
|
||||||
|
Loading…
Reference in New Issue
Block a user