mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Tests: IsDirty
This commit is contained in:
parent
7828f25875
commit
58ef1faaf9
@ -66,6 +66,25 @@ public void AnySyncObjectDirty()
|
|||||||
Assert.That(comp.AnySyncObjectDirty(), Is.True);
|
Assert.That(comp.AnySyncObjectDirty(), Is.True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsDirty()
|
||||||
|
{
|
||||||
|
CreateNetworked(out GameObject _, out NetworkIdentity _, out NetworkBehaviourWithSyncVarsAndCollections comp);
|
||||||
|
|
||||||
|
// not dirty by default
|
||||||
|
Assert.That(comp.IsDirty(), Is.False);
|
||||||
|
|
||||||
|
// changing a [SyncVar] should set it dirty
|
||||||
|
++comp.health;
|
||||||
|
Assert.That(comp.IsDirty(), Is.True);
|
||||||
|
comp.ClearAllDirtyBits();
|
||||||
|
|
||||||
|
// changing a SyncCollection should set it dirty
|
||||||
|
comp.list.Add(42);
|
||||||
|
Assert.That(comp.IsDirty(), Is.True);
|
||||||
|
comp.ClearAllDirtyBits();
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void ClearAllDirtyBitsClearsSyncVarDirtyBits()
|
public void ClearAllDirtyBitsClearsSyncVarDirtyBits()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user