public override void OnInspectorGUI() { EditorGUILayout.Space(); markerFab = (GameObject)EditorGUILayout.ObjectField("Marker Node Prefab", markerFab, typeof(GameObject), false); markerLayout = (MapNav.TilesLayout)EditorGUILayout.EnumPopup("Marker Layout", markerLayout); markerSpacing = EditorGUILayout.FloatField("Marker Node Spacing", markerSpacing); markerSize = EditorGUILayout.FloatField("Marker Node Size", markerSize); EditorGUILayout.BeginHorizontal(); markerRadius = EditorGUILayout.IntField("Marker Radius", markerRadius); if (GUILayout.Button("-")) { markerRadius--; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius); } if (GUILayout.Button("+")) { markerRadius++; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius); } EditorGUILayout.EndHorizontal(); // update the marker with new values EditorGUILayout.Space(); if (GUILayout.Button("Update")) { RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius); } }
public override void OnInspectorGUI() { EditorGUILayout.Space(); markerFab = (GameObject)EditorGUILayout.ObjectField("Marker Node Prefab", markerFab, typeof(GameObject), false); markerLayout = (MapNav.TilesLayout)EditorGUILayout.EnumPopup("Marker Layout", markerLayout); markerSpacing = EditorGUILayout.FloatField("Marker Node Spacing", markerSpacing); markerSize = EditorGUILayout.FloatField("Marker Node Size", markerSize); adaptToTileHeight = EditorGUILayout.Toggle("Adapt to Tile Height", adaptToTileHeight); GUI.enabled = adaptToTileHeight; tilesMask = EditorGUILayout.LayerField("Tiles Layer", tilesMask); GUI.enabled = true; EditorGUILayout.BeginHorizontal(); markerRadius = EditorGUILayout.IntField("Marker Radius", markerRadius); if (GUILayout.Button("-")) { markerRadius--; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius, adaptToTileHeight, tilesMask); } if (GUILayout.Button("+")) { markerRadius++; RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius, adaptToTileHeight, tilesMask); } EditorGUILayout.EndHorizontal(); // update the marker with new values EditorGUILayout.Space(); if (GUILayout.Button("Update")) { RadiusMarker.UpdateMarker(markerFab, (RadiusMarker)target, markerLayout, markerSpacing, markerSize, markerRadius, adaptToTileHeight, tilesMask); } }