mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkBehaviourTests: ComponentIndex simplified
This commit is contained in:
parent
ec332f8b74
commit
edcbaae9a4
@ -270,14 +270,10 @@ public void HasIdentitysConnectionToClient()
|
|||||||
[Test]
|
[Test]
|
||||||
public void ComponentIndex()
|
public void ComponentIndex()
|
||||||
{
|
{
|
||||||
// add one extra component
|
// create a NetworkIdentity with two components
|
||||||
EmptyBehaviour extra = gameObject.AddComponent<EmptyBehaviour>();
|
CreateNetworked(out GameObject _, out NetworkIdentity _, out EmptyBehaviour first, out EmptyBehaviour second);
|
||||||
|
Assert.That(first.ComponentIndex, Is.EqualTo(0));
|
||||||
// original one is first networkbehaviour, so index is 0
|
Assert.That(second.ComponentIndex, Is.EqualTo(1));
|
||||||
Assert.That(emptyBehaviour.ComponentIndex, Is.EqualTo(0));
|
|
||||||
|
|
||||||
// extra one is second networkbehaviour, so index is 1
|
|
||||||
Assert.That(extra.ComponentIndex, Is.EqualTo(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user