mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
More ForceShown fixes
This commit is contained in:
parent
477d430a3f
commit
bf49b6c923
@ -345,13 +345,8 @@ private void RemoveObserversShownToDefault(NetworkIdentity changedIdentity, Vect
|
||||
|
||||
foreach (NetworkIdentity gridIdentity in tile)
|
||||
{
|
||||
if (gridIdentity == changedIdentity)
|
||||
{
|
||||
// Don't do anything with yourself
|
||||
continue;
|
||||
}
|
||||
|
||||
// if the gridIdentity is a player, it can see changedIdentity
|
||||
// (also yourself! don't need the extra check here)
|
||||
if (gridIdentity.connectionToClient != null)
|
||||
{
|
||||
tempShownToDefaultSet.Remove(gridIdentity.connectionToClient);
|
||||
|
@ -154,6 +154,15 @@ public void ForceShown()
|
||||
// A&B should see each other
|
||||
Assert.That(a.observers.ContainsKey(b.connectionToClient.connectionId), Is.True);
|
||||
Assert.That(b.observers.ContainsKey(a.connectionToClient.connectionId), Is.True);
|
||||
// A&B to default
|
||||
a.visibility = Visibility.Default;
|
||||
b.visibility = Visibility.Default;
|
||||
aoi.LateUpdate();
|
||||
AssertSelfVisible(a);
|
||||
AssertSelfVisible(b);
|
||||
// and they can't see each other anymore
|
||||
Assert.That(a.observers.ContainsKey(b.connectionToClient.connectionId), Is.False);
|
||||
Assert.That(b.observers.ContainsKey(a.connectionToClient.connectionId), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Loading…
Reference in New Issue
Block a user