Example #1
0
    /// <summary>
    /// Controls behavior of the inspector.
    /// </summary>
    /// <param name="targ">Editor target.</param>
    public void OnGUIStandard(NMGenAreaMarker targ)
    {
        EditorGUILayout.Separator();

        bool changed = GUI.changed;

        NMGenComponent.debugEnabled =
            EditorGUILayout.Toggle("Show All", NMGenComponent.debugEnabled);

        if (GUI.changed)
        {
            SceneView.RepaintAll();
        }

        GUI.changed = changed;

        EditorGUILayout.Separator();

        // Note: Clamp before sending to property.
        targ.Priority = EditorGUILayout.IntField("Priority", targ.Priority);

        targ.Area = areaControl.OnGUI(targ.Area);

        EditorGUILayout.Separator();
    }
    /// <summary>
    /// Draws the standard gizmo for <see cref="NMGenAreaMarker"/> components.
    /// </summary>
    /// <param name="marker">The marker to draw.</param>
    /// <param name="type">The gizmo type.</param>
    protected static void DrawStandardGizmo(NMGenAreaMarker marker, GizmoType type)
    {
        if (!NMGenAreaMarker.debugEnabled && (type & GizmoType.SelectedOrChild) == 0)
            return;

        Gizmos.color = ColorUtil.IntToColor(marker.Area, 0.6f);

        Vector3 pos = marker.transform.position;

        Gizmos.DrawCube(pos, markerSize);
    }
Example #3
0
    /// <summary>
    /// Draws the standard gizmo for <see cref="NMGenAreaMarker"/> components.
    /// </summary>
    /// <param name="marker">The marker to draw.</param>
    /// <param name="type">The gizmo type.</param>
    protected static void DrawStandardGizmo(NMGenAreaMarker marker, GizmoType type)
    {
        if (!NMGenAreaMarker.debugEnabled && (type & GizmoType.InSelectionHierarchy) == 0)
        {
            return;
        }

        Gizmos.color = ColorUtil.IntToColor(marker.Area, 0.6f);

        Vector3 pos = marker.transform.position;

        Gizmos.DrawCube(pos, markerSize);
    }
    /// <summary>
    /// Controls behavior of the inspector.
    /// </summary>
    /// <param name="targ">Editor target.</param>
    public void OnGUIStandard(NMGenAreaMarker targ)
    {
        EditorGUILayout.Separator();

        bool changed = GUI.changed;

        NMGenComponent.debugEnabled =
            EditorGUILayout.Toggle("Show All", NMGenComponent.debugEnabled);

        if (GUI.changed)
            SceneView.RepaintAll();

        GUI.changed = changed;

        EditorGUILayout.Separator();

        // Note: Clamp before sending to property.
        targ.Priority = EditorGUILayout.IntField("Priority", targ.Priority);

        targ.Area = areaControl.OnGUI(targ.Area);

        EditorGUILayout.Separator();
    }