public static void ShowWindow() { CustomTerrainWindow window = (CustomTerrainWindow)GetWindow(typeof(CustomTerrainWindow)); window.titleContent = new GUIContent("Create Terrain"); window.minSize = new Vector2(410, 400); window.Show(); }
void OnEnable() { // Αssign variables from CustomTerrain.cs into this variables randomHeight = serializedObject.FindProperty("randomHeight"); heightMapScale = serializedObject.FindProperty("heightMapScale"); loadMapImage = serializedObject.FindProperty("loadMapImage"); resetValues = serializedObject.FindProperty("resetValues"); midHeightMin = serializedObject.FindProperty("midHeightMin"); midHeightMax = serializedObject.FindProperty("midHeightMax"); midRoughness = serializedObject.FindProperty("midRoughness"); midHeightDampenerPower = serializedObject.FindProperty("midHeightDampenerPower"); // Get the height Map size from CustomTerrainWindow.cs values of heightMapResolution. CustomTerrainWindow target = new CustomTerrainWindow(); heightMapTexture = new Texture2D(target.heightMapResolution, target.heightMapResolution, TextureFormat.ARGB32, false); }