mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
NetworkBehaviourTests: ComponentIndex
This commit is contained in:
parent
eb977896f8
commit
43909bb40e
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user