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:
MrGadget 2019-03-26 10:40:28 -04:00 committed by vis2k
parent 68f63b5f69
commit d2868646fa
13 changed files with 12 additions and 13 deletions

View File

@ -61,7 +61,6 @@ public void CmdSendLevelLoaded()
private void ReadyStateChanged(bool NewReadyState)
{
ReadyToBegin = NewReadyState;
OnClientReady(ReadyToBegin);
}

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
class MySyncVar : NetworkBehaviour

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
class MySyncVar : ScriptableObject

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
[SyncVar]

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
class MySyncVar<T>

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
interface MySyncVar

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
[SyncVar] int var2;

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook = "OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
public void TakeDamage(int amount)

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
[SyncVar]

View File

@ -15,7 +15,7 @@ public void OnDeserializeDelta(NetworkReader reader) {}
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook = "OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
[SyncVar]

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook = "OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
public void TakeDamage(int amount)

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook="OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
[SyncVar] int var2;

View File

@ -5,7 +5,7 @@ namespace MirrorTest
{
class MirrorTestPlayer : NetworkBehaviour
{
[SyncVar(hook = "OnChangeHealth")]
[SyncVar(hook = nameof(OnChangeHealth))]
int health;
public void TakeDamage(int amount)