NetworkBehaviourTests: ComponentIndex

This commit is contained in:
vis2k 2020-03-05 13:20:31 +01:00
parent eb977896f8
commit 43909bb40e

View File

@ -90,5 +90,18 @@ public void HasIdentitysConnectionToClient()
identity.connectionToClient = new ULocalConnectionToClient();
Assert.That(emptyBehaviour.connectionToClient, Is.EqualTo(identity.connectionToClient));
}
[Test]
public void ComponentIndex()
{
// add one extra component
EmptyBehaviour extra = gameObject.AddComponent<EmptyBehaviour>();
// original one is first networkbehaviour, so index is 0
Assert.That(emptyBehaviour.ComponentIndex, Is.EqualTo(0));
// extra one is second networkbehaviour, so index is 1
Assert.That(extra.ComponentIndex, Is.EqualTo(1));
}
}
}