public void ResetObjects() { // Arrange GameObject go1 = new GameObject(); GameObject go2 = new GameObject(); var r = go1.AddComponent <MeshRenderer>(); var skr = go2.AddComponent <SkinnedMeshRenderer>(); var anim = go2.AddComponent <Animation>(); r.forceRenderingOff = true; skr.updateWhenOffscreen = false; anim.cullingType = AnimationCullingType.BasedOnRenderers; var mockTracker = Substitute.For <ICullingObjectsTracker>(); cullingController = CreateMockedCulledController(null, null, mockTracker); mockTracker.GetRenderers().Returns(info => go1.GetComponentsInChildren <Renderer>()); mockTracker.GetSkinnedRenderers().Returns(info => go2.GetComponentsInChildren <SkinnedMeshRenderer>()); mockTracker.GetAnimations().Returns(info => go2.GetComponentsInChildren <Animation>()); // Act cullingController.ResetObjects(); // Assert Assert.IsFalse(r.forceRenderingOff); Assert.IsTrue(skr.updateWhenOffscreen); Assert.IsTrue(anim.cullingType == AnimationCullingType.AlwaysAnimate); // Annihilate Object.Destroy(go1); Object.Destroy(go2); }
public static PlatformContext CreateDefault() { return(new PlatformContext( memoryManager: new MemoryManager(), cullingController: CullingController.Create(), clipboard: Clipboard.Create(), physicsSyncController: new PhysicsSyncController(), parcelScenesCleaner: new ParcelScenesCleaner(), debugController: new DebugController())); }
public static PlatformContext CreateDefault() { return(new PlatformContext( memoryManager: new MemoryManager(), cullingController: CullingController.Create(), clipboard: Clipboard.Create(), physicsSyncController: new PhysicsSyncController(), parcelScenesCleaner: new ParcelScenesCleaner(), debugController: new DebugController(new BotsController()), webRequest: WebRequestController.Create(), serviceProviders: new ServiceProviders(), idleChecker: new IdleChecker(), avatarsLODController: new AvatarsLODController())); }
public void SetUp() { cullingController = CreateMockedCulledController(null, null, null); }