public override void OnInspectorGUI() { EditoolsLayout.Horizontal(true); EditoolsBox.HelpBoxInfo("Agents Settings"); EditoolsLayout.Horizontal(false); EditoolsLayout.Space(2); EditoolsLayout.Horizontal(true); targetSettings.SpeedMove = EditoolsField.FloatField("Move Speed", targetSettings.SpeedMove); EditoolsLayout.Horizontal(false); EditoolsLayout.Horizontal(true); targetSettings.SpeedRotation = EditoolsField.FloatField("Rotation Speed", targetSettings.SpeedRotation); EditoolsLayout.Horizontal(false); EditoolsLayout.Horizontal(true); EditoolsField.Toggle("Add LookAt ?", ref targetSettings.UseLookAt); EditoolsLayout.Horizontal(false); EditoolsLayout.Horizontal(true); if (targetSettings.UseLookAt) { EditoolsBox.HelpBox("LookAt Target"); targetSettings.TargetLookAt = (GameObject)EditoolsField.ObjectField(targetSettings.TargetLookAt, typeof(GameObject), true); } EditoolsLayout.Horizontal(false); EditorUtility.SetDirty(targetSettings); // flush value }
public override void OnInspectorGUI() { base.OnInspectorGUI(); EditoolsBox.HelpBoxInfo($"Terrain generator build : {eTarget.Version}"); GUILayout.Label("Initials corner value for heightmap generation"); EditoolsField.FloatField("Up Left", ref eTarget.cornerUpLeft); EditoolsField.FloatField("Up Right", ref eTarget.cornerUpRight); EditoolsField.FloatField("Down Left", ref eTarget.cornerDownLeft); EditoolsField.FloatField("Down Right", ref eTarget.cornerDownRight); EditoolsBox.HelpBoxInfo("The map size will be of equation 2 ^ power + 1"); EditoolsField.IntField("power", ref eTarget.power); EditoolsField.IntField("Random range", ref eTarget.randomRange); EditoolsLayout.Space(); GUILayout.Label("Rasterization settings : "); EditoolsField.Toggle("Use min and max value", ref eTarget.useMinMax); EditoolsField.FloatField("Maximum value", ref eTarget.maxValue); EditoolsField.FloatField("Minimum value", ref eTarget.minValue); EditoolsLayout.Space(); /*EditoolsLayout.Space(); * EditoolsButton.Button("Generate Height map", Color.white, GenerateHeightMap); * EditoolsLayout.Space();*/ EditoolsLayout.Space(); EditoolsButton.Button("Create Map", Color.white, CreateMap); EditoolsLayout.Space(); displayArray = EditoolsLayout.Foldout(displayArray, "Heightmap Content"); if (displayArray) { if (eTarget.heightMap == null) { EditoolsBox.HelpBoxError("No valid heightmap"); } else { DisplayTwoDimentionalArray(eTarget.heightMap); } } }