示例#1
0
        public SceneContext(
            IGroupSelector groupSelector,
            ITerrainGenerator2i terrainGenerator,
            IMeshUpdater meshUpdater,
            Vector3 cameraPosition,
            IReadOnlyList <Plane> cameraPlanes,
            IReadOnlyPooledList <Vector3> cameraFrustumCorners,
            Matrix4x4 cameraLocalToWorldMatrix,
            Matrix4x4 parentContainerWorldToLocalMatrix,
            IReadOnlySet <Vector2i> existingGroups,
            Vector2i cellInGroupCount,
            IImage2i image,
            Rect2i invalidatedArea_imageSpace,
            IImageSampler2i imageSampler,
            Func <GameObject> gameObjectFactory,
            ProfilerFactoryDelegate profilerFactory,
            LoggerFactoryDelegate loggerFactory)
        {
            GroupSelector                     = groupSelector;
            TerrainGenerator                  = terrainGenerator;
            MeshUpdater                       = meshUpdater;
            CameraPosition                    = cameraPosition;
            CameraPlanes                      = cameraPlanes;
            CameraFrustumCorners              = cameraFrustumCorners;
            CameraLocalToWorldMatrix          = cameraLocalToWorldMatrix;
            ParentContainerWorldToLocalMatrix = parentContainerWorldToLocalMatrix;
            ExistingGroups                    = existingGroups;
            CellInGroupCount                  = cellInGroupCount;
            Image             = image;
            ImageSampler      = imageSampler;
            GameObjectFactory = gameObjectFactory;
            ProfilerFactory   = profilerFactory;
            LoggerFactory     = loggerFactory;

            RangeZ      = image.RangeZ;
            GroupBounds = new Bounds(new Vector3(CellInGroupCount.x / 2.0f, CellInGroupCount.y / 2.0f, RangeZ.Center), new Vector3(CellInGroupCount.x, CellInGroupCount.y, RangeZ.Size));
            InvalidatedArea_worldSpace = ImageSampler
                                         .ImageToWorld(invalidatedArea_imageSpace)
                                         .RoundToContain();

            (Image as IInitializableImage)?.StartUsing();
        }
示例#2
0
 public static IProfiler Create <T>(this ProfilerFactoryDelegate factory)
 {
     return(factory(typeof(T).FullName, null));
 }
示例#3
0
 public static IProfiler Create(this ProfilerFactoryDelegate factory, string name)
 {
     return(factory(name, null));
 }
示例#4
0
 public static IProfiler Create(this ProfilerFactoryDelegate factory, object instance)
 {
     return(factory(instance.GetType().FullName, instance));
 }
示例#5
0
 public static IProfiler Create(this ProfilerFactoryDelegate factory, Type type)
 {
     return(factory(type.FullName, null));
 }