From ef41ad6074a9e157496b2be3d46e0c195668ddc3 Mon Sep 17 00:00:00 2001 From: nothingTVatYT <34131388+nothingTVatYT@users.noreply.github.com> Date: Mon, 29 Jan 2024 07:34:58 +0100 Subject: [PATCH] add units to transform editor, some collider values --- Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs | 6 ++++++ Source/Engine/Physics/Colliders/Collider.h | 4 ++-- Source/Engine/Physics/Colliders/SphereCollider.h | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs index 4c153e759..a33163aab 100644 --- a/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs +++ b/Source/Editor/CustomEditors/Editors/ActorTransformEditor.cs @@ -42,10 +42,13 @@ namespace FlaxEditor.CustomEditors.Editors var grayOutFactor = 0.6f; XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, grayOutFactor); XElement.ValueBox.BorderSelectedColor = AxisColorX; + XElement.ValueBox.Category = Utils.ValueCategory.Distance; YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, grayOutFactor); YElement.ValueBox.BorderSelectedColor = AxisColorY; + YElement.ValueBox.Category = Utils.ValueCategory.Distance; ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor); ZElement.ValueBox.BorderSelectedColor = AxisColorZ; + ZElement.ValueBox.Category = Utils.ValueCategory.Distance; } } @@ -65,10 +68,13 @@ namespace FlaxEditor.CustomEditors.Editors var grayOutFactor = 0.6f; XElement.ValueBox.BorderColor = Color.Lerp(AxisColorX, back, grayOutFactor); XElement.ValueBox.BorderSelectedColor = AxisColorX; + XElement.ValueBox.Category = Utils.ValueCategory.Angle; YElement.ValueBox.BorderColor = Color.Lerp(AxisColorY, back, grayOutFactor); YElement.ValueBox.BorderSelectedColor = AxisColorY; + YElement.ValueBox.Category = Utils.ValueCategory.Angle; ZElement.ValueBox.BorderColor = Color.Lerp(AxisColorZ, back, grayOutFactor); ZElement.ValueBox.BorderSelectedColor = AxisColorZ; + ZElement.ValueBox.Category = Utils.ValueCategory.Angle; } } diff --git a/Source/Engine/Physics/Colliders/Collider.h b/Source/Engine/Physics/Colliders/Collider.h index bd17aa27a..e5a873b77 100644 --- a/Source/Engine/Physics/Colliders/Collider.h +++ b/Source/Engine/Physics/Colliders/Collider.h @@ -52,7 +52,7 @@ public: /// /// Gets the center of the collider, measured in the object's local space. /// - API_PROPERTY(Attributes="EditorOrder(10), DefaultValue(typeof(Vector3), \"0,0,0\"), EditorDisplay(\"Collider\")") + API_PROPERTY(Attributes="EditorOrder(10), DefaultValue(typeof(Vector3), \"0,0,0\"), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)") FORCE_INLINE Vector3 GetCenter() const { return _center; @@ -66,7 +66,7 @@ public: /// /// Gets the contact offset. Colliders whose distance is less than the sum of their ContactOffset values will generate contacts. The contact offset must be positive. Contact offset allows the collision detection system to predictively enforce the contact constraint even when the objects are slightly separated. /// - API_PROPERTY(Attributes="EditorOrder(1), DefaultValue(2.0f), Limit(0, 100), EditorDisplay(\"Collider\")") + API_PROPERTY(Attributes="EditorOrder(1), DefaultValue(2.0f), Limit(0, 100), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)") FORCE_INLINE float GetContactOffset() const { return _contactOffset; diff --git a/Source/Engine/Physics/Colliders/SphereCollider.h b/Source/Engine/Physics/Colliders/SphereCollider.h index 061372af4..6adaf76ba 100644 --- a/Source/Engine/Physics/Colliders/SphereCollider.h +++ b/Source/Engine/Physics/Colliders/SphereCollider.h @@ -21,7 +21,7 @@ public: /// Gets the radius of the sphere, measured in the object's local space. /// /// The sphere radius will be scaled by the actor's world scale. - API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(50.0f), EditorDisplay(\"Collider\")") + API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(50.0f), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)") FORCE_INLINE float GetRadius() const { return _radius;