Scope sample classes

This commit is contained in:
Paul Pacheco 2020-04-22 20:54:08 -05:00
parent d0df3e8b90
commit 2ad16332f3
2 changed files with 12 additions and 11 deletions

View File

@ -86,7 +86,7 @@ public void SyncVarsSyncList()
{
Assert.That(CompilationFinishedHook.WeaveFailed, Is.False);
Assert.That(weaverErrors, Is.Empty);
Assert.That(weaverWarnings, Contains.Item("Mirror.Weaver warning: MirrorTest.SyncObjImplementer MirrorTest.SyncVarsSyncList::syncobj has [SyncVar] attribute. SyncLists should not be marked with SyncVar"));
Assert.That(weaverWarnings, Contains.Item("Mirror.Weaver warning: MirrorTest.SyncVarsSyncList/SyncObjImplementer MirrorTest.SyncVarsSyncList::syncobj has [SyncVar] attribute. SyncLists should not be marked with SyncVar"));
Assert.That(weaverWarnings, Contains.Item("Mirror.Weaver warning: Mirror.SyncListInt MirrorTest.SyncVarsSyncList::syncints has [SyncVar] attribute. SyncLists should not be marked with SyncVar"));
}

View File

@ -3,19 +3,20 @@
namespace MirrorTest
{
public class SyncObjImplementer : SyncObject
{
public bool IsDirty { get; }
public void Flush() {}
public void OnSerializeAll(NetworkWriter writer) {}
public void OnSerializeDelta(NetworkWriter writer) {}
public void OnDeserializeAll(NetworkReader reader) {}
public void OnDeserializeDelta(NetworkReader reader) {}
public void Reset() {}
}
class SyncVarsSyncList : NetworkBehaviour
{
public class SyncObjImplementer : SyncObject
{
public bool IsDirty { get; }
public void Flush() { }
public void OnSerializeAll(NetworkWriter writer) { }
public void OnSerializeDelta(NetworkWriter writer) { }
public void OnDeserializeAll(NetworkReader reader) { }
public void OnDeserializeDelta(NetworkReader reader) { }
public void Reset() { }
}
[SyncVar(hook = nameof(OnChangeHealth))]
int health;