Esempio n. 1
0
        public GridValueTextureCalculator GetGridValueTextureCalculator(RenderTexture renderTexture2d, PartitionSettings partitionSettings)
        {
            var gridSizeX    = partitionSettings.SpaceSettings.GridSize[0];
            var textureArray = GetTextureNativeArray(renderTexture2d);
            var calculator   = new GridValueTextureCalculator(textureArray, gridSizeX);

            return(calculator);
        }
Esempio n. 2
0
        public List <IGridCellValueGetter> GetGridCellsGetters(RenderTexture gridsRenderTexture, PartitionSettings partitionSettings)
        {
            var list = new List <IGridCellValueGetter>();

            for (var centerIndex = 0; centerIndex < partitionSettings.CentersSettings.CentersCount; centerIndex++)
            {
                var data = GetTextureNativeArray(gridsRenderTexture, centerIndex);

                Assert.AreEqual(data.Length, partitionSettings.SpaceSettings.GridSize[0] * partitionSettings.SpaceSettings.GridSize[1]);

                var valueTextureGetter = new GridValueTextureCalculator(data, partitionSettings.SpaceSettings.GridSize[0]);

                list.Add(valueTextureGetter);
            }

            return(list);
        }