public override void SetUp() { base.SetUp(); // create spatial hashing object & component CreateGameObject(out GameObject go, out aoi); aoi.visRange = 10; // setup server aoi since InterestManagement Awake isn't called NetworkServer.aoi = aoi; // rebuild grid once so the two connections are in there aoi.Update(); }
public override void ForceShown_Initial() { // A and B are too far from each other identityB.transform.position = Vector3.right * (aoi.visRange + 1); // force show A identityA.visible = Visibility.ForceShown; // update grid now that positions were changed aoi.Update(); // rebuild for both // initial rebuild while both are within range NetworkServer.RebuildObservers(identityA, true); NetworkServer.RebuildObservers(identityB, true); // A should see B because A is force shown Assert.That(identityA.observers.ContainsKey(connectionB.connectionId), Is.True); // B should not be seen by A because they are too far from each other Assert.That(identityB.observers.ContainsKey(connectionA.connectionId), Is.False); }
public override void SetUp() { GameObject go = new GameObject(); aoi = go.AddComponent <SpatialHashingInterestManagement>(); aoi.visRange = 10; // setup server aoi since InterestManagement Awake isn't called NetworkServer.aoi = aoi; base.SetUp(); // rebuild grid once so the two connections are in there aoi.Update(); }