public override void OnInspectorGUI() { FloatIslandGen mapGen = (FloatIslandGen)target; bool defaultInspect = DrawDefaultInspector(); if (defaultInspect) { if (mapGen.autoUpdate) { mapGen.Refresh(); } } if (GUILayout.Button("Generate")) { mapGen.Refresh(); } isFold1 = EditorGUILayout.Foldout(isFold1, "Show bot Textures"); if (isFold1) { GUILayout.Label("noiseTexture"); GUILayout.Label(mapGen.botIsland.noiseTexture); GUILayout.Label("colorTexture"); GUILayout.Label(mapGen.botIsland.colorTexture); GUILayout.Label("falloffTexture"); GUILayout.Label(mapGen.botIsland.fallOffTexture); } isFold2 = EditorGUILayout.Foldout(isFold2, "Show top Textures"); if (isFold2) { GUILayout.Label("noiseTexture"); GUILayout.Label(mapGen.topIsland.noiseTexture); GUILayout.Label("colorTexture"); GUILayout.Label(mapGen.topIsland.colorTexture); GUILayout.Label("falloffTexture"); GUILayout.Label(mapGen.topIsland.fallOffTexture); } if (mapGen.useRiver) { GUILayout.Label("River Map"); GUILayout.Label(mapGen.riverTexture); } /* * Texture2D myTexture = AssetPreview.GetAssetPreview(object); * GUILayout.Label(myTexture); */ }
public void Refresh() { if (gen.topIsland.fallOffMap == null) { Debug.LogWarning("Island not generated before, did it for you"); gen.Refresh(); } DestroyChilds(genTransform); List <Vector3> vs = PlaceTrees2(gen.mapChunkSize, gen.mapChunkSize, gen.seed, R, gen.topIsland.fallOffMap); DestroyChilds(genTransform); InstantiateTrees(vs); }