private void Refresh() { var tranes = GetSelections(); if (tranes.Length == 0) { return; } var bounds = GenerateBounds(tranes); var arrayWidth = Mathf.FloorToInt(bounds.size.x) + 1 + TextureEdgeSize * 2; var arrayHeight = Mathf.FloorToInt(bounds.size.z) + 1 + TextureEdgeSize * 2; var hits = SceneJobUtility.RaycastGrid(bounds.center, arrayWidth, arrayHeight, _checkLayerMask, _maxHits); DebugRaycast(hits); _sceneRaycastInfo.UpdateData(arrayWidth, arrayHeight, hits, _maxHits, bounds.center); _previewTexture = SceneInfoCalculation.GetTexture(_sceneRaycastInfo, _calculateType, _minRange, _maxRange, _generateLayerMask); }
public static void GenerateByTexture(List <ScenePrefab> scenePrefabs, Transform parent, Texture2D tex, Vector3 center, int space) { var hits = SceneJobUtility.RaycastGrid(center, tex.width, tex.height); Generate(scenePrefabs, parent, tex, hits, space); }