public void Start() { _once = new RunOnceBox(() => { var screenSize = new IntVector2(Screen.width, Screen.height); var blockSize = new IntVector2(16, 16); var blockCount = new IntVector2(Mathf.CeilToInt(screenSize.X / (float)blockSize.X), Mathf.CeilToInt(screenSize.Y / (float)blockSize.Y)); var divisionSettings = new GridDivisionSettings() { BlockCount = blockCount, BlockSize = blockSize, ScreenSize = screenSize }; FindObjectOfType <LineMeasuringPpDirectorOc>().RequireScreenshotsSet((screenshotsSet) => { var gauge = new BlockSpecificationGauge(divisionSettings); var result = gauge.TakeMeasurement(screenshotsSet); var ppDirector = FindObjectOfType <DebugIllustrationPPDirectorOC>(); ppDirector.ShowIllustrations(screenshotsSet.HatchMainTexture.ToTexture2D(), result.GenerateIllustration()); File.WriteAllText(@"C:\mgr\tmp\blockFilling.json", JsonUtility.ToJson(result.GeneratePoco())); }); }, 4); }
public BlockSpecificationGauge(GridDivisionSettings divisionSettings) { _divisionSettings = divisionSettings; }
public BlockSpecificationResult(List <OneBlockSpecificationInformation> fillingInfos, GridDivisionSettings gridDivisionSettings) { _fillingInfos = fillingInfos; _gridDivisionSettings = gridDivisionSettings; }