-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: general improvements to CustomEditor type cache and ScriptedEditor
- Loading branch information
Showing
9 changed files
with
149 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,4 +434,4 @@ internal static WidgetStyle GetInputStyle() | |
|
||
#endregion | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This file is part of the Prowl Game Engine | ||
// Licensed under the MIT License. See the LICENSE file in the project root for details. | ||
|
||
using Prowl.Runtime; | ||
using Prowl.Editor.Assets; | ||
|
||
using static Prowl.Editor.EditorGUI; | ||
|
||
namespace Prowl.Editor; | ||
|
||
[CustomEditor(typeof(MonoBehaviour))] | ||
public class ComponentEditor : ScriptedEditor | ||
{ | ||
private MonoBehaviour? _component; | ||
|
||
|
||
public override void OnEnable() | ||
{ | ||
_component = target as MonoBehaviour; | ||
} | ||
|
||
|
||
public override void OnInspectorGUI() | ||
{ | ||
if (_component == null) | ||
return; | ||
|
||
object componentRef = _component; | ||
if (PropertyGrid("ComponentPropertyGrid", ref componentRef, TargetFields.Serializable | TargetFields.Properties, PropertyGridConfig.NoHeader | PropertyGridConfig.NoBorder | PropertyGridConfig.NoBackground)) | ||
_component.OnValidate(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.