-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from arimger/develop
Develop - 0.13.2
- Loading branch information
Showing
56 changed files
with
596 additions
and
203 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
13 changes: 13 additions & 0 deletions
13
Assets/Editor Toolbox/Editor/Drawers/ISerializedPropertyContext.cs
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,13 @@ | ||
using System; | ||
using System.Reflection; | ||
using UnityEditor; | ||
|
||
namespace Toolbox.Editor.Drawers | ||
{ | ||
public interface ISerializedPropertyContext | ||
{ | ||
SerializedProperty Property { get; } | ||
FieldInfo FieldInfo { get; } | ||
Type Type { get; } | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...oolbox/Editor/ToolboxDrawerModule.cs.meta → ...rawers/ISerializedPropertyContext.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
Assets/Editor Toolbox/Editor/Drawers/Regular/AnimationCurveSettingsAttributeDrawer.cs
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 @@ | ||
using UnityEditor; | ||
using UnityEngine; | ||
|
||
namespace Toolbox.Editor.Drawers | ||
{ | ||
[CustomPropertyDrawer(typeof(AnimationCurveSettingsAttribute))] | ||
public class AnimationCurveSettingsAttributeDrawer : PropertyDrawerBase | ||
{ | ||
protected override void OnGUISafe(Rect position, SerializedProperty property, GUIContent label) | ||
{ | ||
var attribute = Attribute; | ||
var curveRanges = new Rect( | ||
attribute.Min.x, | ||
attribute.Min.y, | ||
attribute.Max.x - attribute.Min.x, | ||
attribute.Max.y - attribute.Min.y); | ||
|
||
var color = attribute.Color; | ||
|
||
EditorGUI.BeginProperty(position, label, property); | ||
EditorGUI.CurveField(position, property, color, curveRanges, label); | ||
EditorGUI.EndProperty(); | ||
} | ||
|
||
public override bool IsPropertyValid(SerializedProperty property) | ||
{ | ||
return base.IsPropertyValid(property) && property.propertyType == SerializedPropertyType.AnimationCurve; | ||
} | ||
|
||
private AnimationCurveSettingsAttribute Attribute => attribute as AnimationCurveSettingsAttribute; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Assets/Editor Toolbox/Editor/Drawers/Regular/AnimationCurveSettingsAttributeDrawer.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
/// </summary> | ||
public abstract class ToolboxAttributeDrawer : ToolboxDrawer | ||
{ } | ||
} | ||
} |
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.