void Start() { _mrMapGenerator = FindObjectOfType <MRMapGenerator>(); maxViewDist = detailLevels[detailLevels.Length - 1].visibleDistThreshold; chunkSize = MRMapGenerator.mapChunkSize - 1; chunksVisibleInViewDist = Mathf.RoundToInt(maxViewDist / chunkSize); UpdateVisibleChunks(); }
public override void OnInspectorGUI() { MRMapGenerator mrMapGen = (MRMapGenerator)target; if (DrawDefaultInspector()) { if (mrMapGen.autoUpdate) { mrMapGen.DrawMapInEditor(); } } if (GUILayout.Button("Generate")) { mrMapGen.DrawMapInEditor(); } }