-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
|
||
|
||
namespace Signals.Common | ||
{ | ||
[CustomPropertyDrawer(typeof(QuaternionValueReference))] | ||
public class QuaternionValueReferenceDrawer : ValueReferenceDrawer | ||
{ | ||
static Vector4 QuaternionToVector4(Quaternion quaternion) | ||
{ | ||
return new Vector4(quaternion.x, quaternion.y, quaternion.z, quaternion.w); | ||
} | ||
|
||
static Quaternion Vector4ToQuaternion(Vector4 vector) | ||
{ | ||
return new Quaternion(vector.x, vector.y, vector.z, vector.w); | ||
} | ||
|
||
protected override void LocalValueField(Rect position, SerializedProperty localValue) | ||
{ | ||
localValue.quaternionValue = Vector4ToQuaternion(EditorGUI.Vector4Field(position, GUIContent.none, QuaternionToVector4(localValue.quaternionValue))); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using UnityEditor; | ||
|
||
|
||
|
||
namespace Signals.Common | ||
{ | ||
[CustomPropertyDrawer(typeof(Vector2IntValueReference))] | ||
public class Vector2IntValueReferenceDrawer : ValueReferenceDrawer { } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using UnityEditor; | ||
|
||
|
||
|
||
namespace Signals.Common | ||
{ | ||
[CustomPropertyDrawer(typeof(Vector2ValueReference))] | ||
public class Vector2ValueReferenceDrawer : ValueReferenceDrawer { } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using UnityEditor; | ||
|
||
|
||
|
||
namespace Signals.Common | ||
{ | ||
[CustomPropertyDrawer(typeof(Vector3IntValueReference))] | ||
public class Vector3IntValueReferenceDrawer : ValueReferenceDrawer { } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using UnityEditor; | ||
|
||
|
||
|
||
namespace Signals.Common | ||
{ | ||
[CustomPropertyDrawer(typeof(Vector3ValueReference))] | ||
public class Vector3ValueReferenceDrawer : ValueReferenceDrawer { } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
|
||
|
||
namespace Signals.Common | ||
{ | ||
[CustomPropertyDrawer(typeof(Vector4ValueReference))] | ||
public class Vector4ValueReferenceDrawer : ValueReferenceDrawer | ||
{ | ||
protected override void LocalValueField(Rect position, SerializedProperty localValue) | ||
{ | ||
localValue.vector4Value = EditorGUI.Vector4Field(position, GUIContent.none, localValue.vector4Value); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.