mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
AOI Test: use CreateGameObject for automated tracking & destroying
This commit is contained in:
parent
5c8bd25b7e
commit
0888776f06
@ -11,18 +11,19 @@ public class InterestManagementTests_Distance : InterestManagementTests_Common
|
||||
[SetUp]
|
||||
public override void SetUp()
|
||||
{
|
||||
GameObject go = new GameObject();
|
||||
base.SetUp();
|
||||
|
||||
// create AOI GameObject
|
||||
CreateGameObject(out GameObject go);
|
||||
aoi = go.AddComponent<DistanceInterestManagement>();
|
||||
aoi.visRange = 10;
|
||||
// setup server aoi since InterestManagement Awake isn't called
|
||||
NetworkServer.aoi = aoi;
|
||||
base.SetUp();
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public override void TearDown()
|
||||
{
|
||||
GameObject.DestroyImmediate(aoi.gameObject);
|
||||
base.TearDown();
|
||||
// clear server aoi again
|
||||
NetworkServer.aoi = null;
|
||||
|
Loading…
Reference in New Issue
Block a user