mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00: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]
|
[SetUp]
|
||||||
public override void SetUp()
|
public override void SetUp()
|
||||||
{
|
{
|
||||||
GameObject go = new GameObject();
|
base.SetUp();
|
||||||
|
|
||||||
|
// create AOI GameObject
|
||||||
|
CreateGameObject(out GameObject go);
|
||||||
aoi = go.AddComponent<DistanceInterestManagement>();
|
aoi = go.AddComponent<DistanceInterestManagement>();
|
||||||
aoi.visRange = 10;
|
aoi.visRange = 10;
|
||||||
// setup server aoi since InterestManagement Awake isn't called
|
// setup server aoi since InterestManagement Awake isn't called
|
||||||
NetworkServer.aoi = aoi;
|
NetworkServer.aoi = aoi;
|
||||||
base.SetUp();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
public override void TearDown()
|
public override void TearDown()
|
||||||
{
|
{
|
||||||
GameObject.DestroyImmediate(aoi.gameObject);
|
|
||||||
base.TearDown();
|
base.TearDown();
|
||||||
// clear server aoi again
|
// clear server aoi again
|
||||||
NetworkServer.aoi = null;
|
NetworkServer.aoi = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user