Skip to content

Commit

Permalink
Add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvinas01 committed Oct 6, 2023
1 parent a11f184 commit 038e69e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace CHARK.GameManagement.Editor.Settings
internal sealed class GameManagerSettingsProfilePropertyDrawer : PropertyDrawer
{
private const float ToggleWidth = 16f;

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var profile = property.objectReferenceValue as GameManagerSettingsProfile;
Expand All @@ -19,6 +20,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
GUI.backgroundColor = Color.green;
}

// Active toggle
EditorGUI.BeginChangeCheck();

var togglePosition = position;
Expand All @@ -33,6 +35,7 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
profile.IsActiveProfile = isActiveProfileNew;
}

// Profile object field
var propertyPosition = position;
propertyPosition.width -= ToggleWidth;
propertyPosition.x += ToggleWidth;
Expand Down

0 comments on commit 038e69e

Please sign in to comment.