コード例 #1
0
        public void Reset()
        {
            EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
            mockMesher           = new MockMesher(mockGetComponent);
            mockMesher.CullFaces = true;//by default mesher is dependent on neighbour, as only the naive mesher is not
            mockProvider         = new MockProvider();
            mockComponentStorage = new Dictionary <Vector3Int, MockChunkComponent>();
            mockPlayChunkID      = Vector3Int.zero;
            mockLightManager     = Substitute.For <ILightManager>();
            mockLightManager.CreateGenerationJob(Arg.Any <Vector3Int>())
            .Returns(args =>
            {
                return(new BasicFunctionJob <LightmapGenerationJobResult>(() => new LightmapGenerationJobResult()));
            });

            mockManager = Substitute.For <IChunkManager>();
            mockManager.GetChunkComponent(Arg.Any <Vector3Int>())
            .Returns(args =>
            {
                var chunkId = (Vector3Int)args[0];
                return(mockGetComponent(chunkId));
            });
            mockManager.GetManhattanDistanceFromPlayer(Arg.Any <Vector3Int>())
            .Returns(args => {
                var chunkId = (Vector3Int)args[0];
                return(MockGetPriorityOfChunk(chunkId));
            });
            worldLimits = new WorldSizeLimits(false, 0);
            worldLimits.Initalise();
            mockManager.WorldLimits.Returns(worldLimits);
        }
コード例 #2
0
 protected override AbstractPipelineJob <LightmapGenerationJobResult> MakeJob(Vector3Int chunkId)
 {
     return(lightManager.CreateGenerationJob(chunkId));
 }
コード例 #3
0
 public AbstractPipelineJob <LightmapGenerationJobResult> CreateGenerationJob(Vector3Int chunkId)
 {
     return(lightManager.CreateGenerationJob(chunkId));
 }