File tree Expand file tree Collapse file tree 7 files changed +23
-31
lines changed
org.mixedrealitytoolkit.spatialmanipulation
org.mixedrealitytoolkit.uxcore/Interop Expand file tree Collapse file tree 7 files changed +23
-31
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) Mixed Reality Toolkit Contributors
22// Licensed under the BSD 3-Clause
33
4+ using System ;
45using Unity . Profiling ;
6+ using Unity . XR . CoreUtils . GUI ;
57using UnityEngine ;
68using UnityEngine . XR . Interaction . Toolkit ;
79using static MixedReality . Toolkit . SpatialManipulation . ObjectManipulator ;
8- using System ;
9-
10- #if UNITY_EDITOR
11- using UnityEditor ;
12- #endif
1310
1411namespace MixedReality . Toolkit . SpatialManipulation
1512{
@@ -262,8 +259,7 @@ public HandleType EnabledHandles
262259 set => enabledHandles = value ;
263260 }
264261
265- [ EnumFlags ]
266- [ SerializeField ]
262+ [ SerializeField , FlagsProperty ]
267263 [ Tooltip ( "Specifies whether the rotate handles will rotate the object around its origin, or the center of its calculated bounds." ) ]
268264 private RotateAnchorType rotateAnchor = RotateAnchorType . BoundsCenter ;
269265
@@ -282,8 +278,7 @@ public RotateAnchorType RotateAnchor
282278 }
283279 }
284280
285- [ EnumFlags ]
286- [ SerializeField ]
281+ [ SerializeField , FlagsProperty ]
287282 [ Tooltip ( "Specifies whether the scale handles will rotate the object around their opposing corner, or the center of its calculated bounds." ) ]
288283 private ScaleAnchorType scaleAnchor = ScaleAnchorType . OppositeCorner ;
289284
Original file line number Diff line number Diff line change 11// Copyright (c) Mixed Reality Toolkit Contributors
22// Licensed under the BSD 3-Clause
33
4+ using Unity . XR . CoreUtils . GUI ;
45using UnityEngine ;
56
67namespace MixedReality . Toolkit . SpatialManipulation
@@ -17,8 +18,7 @@ public class MoveAxisConstraint : TransformConstraint
1718 {
1819 #region Properties
1920
20- [ SerializeField ]
21- [ EnumFlags ]
21+ [ SerializeField , FlagsProperty ]
2222 [ Tooltip ( "Constrain movement along an axis" ) ]
2323 private AxisFlags constraintOnMovement = 0 ;
2424
@@ -103,4 +103,4 @@ public override void ApplyConstraint(ref MixedRealityTransform transform)
103103
104104 #endregion Public Methods
105105 }
106- }
106+ }
Original file line number Diff line number Diff line change 11// Copyright (c) Mixed Reality Toolkit Contributors
22// Licensed under the BSD 3-Clause
33
4+ using Unity . XR . CoreUtils . GUI ;
45using UnityEngine ;
56
67namespace MixedReality . Toolkit . SpatialManipulation
@@ -16,8 +17,7 @@ public class RotationAxisConstraint : TransformConstraint
1617 {
1718 #region Properties
1819
19- [ SerializeField ]
20- [ EnumFlags ]
20+ [ SerializeField , FlagsProperty ]
2121 [ Tooltip ( "Constrain rotation about an axis" ) ]
2222 private AxisFlags constraintOnRotation = 0 ;
2323
@@ -78,4 +78,4 @@ public override void ApplyConstraint(ref MixedRealityTransform transform)
7878
7979 #endregion Public Methods
8080 }
81- }
81+ }
Original file line number Diff line number Diff line change 11// Copyright (c) Mixed Reality Toolkit Contributors
22// Licensed under the BSD 3-Clause
33
4- using System ;
4+ using Unity . XR . CoreUtils . GUI ;
55using UnityEngine ;
66
77namespace MixedReality . Toolkit . SpatialManipulation
@@ -17,8 +17,7 @@ public abstract class TransformConstraint : MonoBehaviour
1717 {
1818 #region Properties
1919
20- [ SerializeField ]
21- [ EnumFlags ]
20+ [ SerializeField , FlagsProperty ]
2221 [ Tooltip ( "What type of manipulation this constraint applies to. Defaults to One Handed and Two Handed." ) ]
2322 private ManipulationHandFlags handType = ManipulationHandFlags . OneHanded | ManipulationHandFlags . TwoHanded ;
2423
@@ -31,8 +30,7 @@ public ManipulationHandFlags HandType
3130 set => handType = value ;
3231 }
3332
34- [ SerializeField ]
35- [ EnumFlags ]
33+ [ SerializeField , FlagsProperty ]
3634 [ Tooltip ( "What type of manipulation this constraint applies to. Defaults to Near and Far." ) ]
3735 private ManipulationProximityFlags proximityType = ManipulationProximityFlags . Near | ManipulationProximityFlags . Far ;
3836
Original file line number Diff line number Diff line change 44using System ;
55using System . Collections . Generic ;
66using Unity . Profiling ;
7+ using Unity . XR . CoreUtils . GUI ;
78using UnityEngine ;
89using UnityEngine . Serialization ;
910using UnityEngine . XR . Interaction . Toolkit ;
@@ -135,8 +136,7 @@ public Transform HostTransform
135136 }
136137 }
137138
138- [ SerializeField ]
139- [ EnumFlags ]
139+ [ SerializeField , FlagsProperty ]
140140 [ Tooltip ( "What kinds of manipulation should be allowed?" ) ]
141141 private TransformFlags allowedManipulations = TransformFlags . Move | TransformFlags . Rotate | TransformFlags . Scale ;
142142
@@ -288,8 +288,7 @@ public RotateAnchorType RotationAnchorFar
288288 set => rotationAnchorFar = value ;
289289 }
290290
291- [ SerializeField ]
292- [ EnumFlags ]
291+ [ SerializeField , FlagsProperty ]
293292 [ Tooltip ( "Rigid body behavior of the dragged object when releasing it." ) ]
294293 private ReleaseBehaviorType releaseBehavior = ReleaseBehaviorType . KeepVelocity | ReleaseBehaviorType . KeepAngularVelocity ;
295294
Original file line number Diff line number Diff line change 22// Licensed under the BSD 3-Clause
33
44using Unity . Profiling ;
5+ using Unity . XR . CoreUtils . GUI ;
56using UnityEngine ;
67using UnityEngine . Serialization ;
78
@@ -69,8 +70,7 @@ public Transform TargetToFace
6970 set => targetToFace = value ;
7071 }
7172
72- [ SerializeField ]
73- [ EnumFlags ]
73+ [ SerializeField , FlagsProperty ]
7474 [ Tooltip ( "Rotation axes used when facing target." ) ]
7575 private AxisFlags pivotAxis = AxisFlags . XAxis | AxisFlags . YAxis | AxisFlags . ZAxis ;
7676
Original file line number Diff line number Diff line change 33
44using System . Collections ;
55using System . Collections . Generic ;
6+ using Unity . XR . CoreUtils . GUI ;
67using UnityEngine ;
78using UnityEngine . EventSystems ;
89using UnityEngine . UI ;
@@ -38,8 +39,7 @@ protected IXRInteractable ThisInteractable
3839 }
3940 }
4041
41- [ SerializeField ]
42- [ EnumFlags ]
42+ [ SerializeField , FlagsProperty ]
4343 [ Tooltip ( "Which axes should be used for manipulation instead of navigation?" ) ]
4444 private AxisFlags movableAxes = 0 ;
4545
@@ -109,9 +109,9 @@ internal protected XRInteractionManager InteractionManager
109109 /// A Unity Editor only event function that is called when the script is loaded or a value changes in the Unity Inspector.
110110 /// </summary>
111111 protected override void OnValidate ( )
112- {
112+ {
113113 base . OnValidate ( ) ;
114-
114+
115115 // Validate that no transition type is set. You shouldn't be using this
116116 // for any sort of UI visuals; use a StatefulInteractable and a
117117 // StateVisualizer instead, even for UI.
@@ -416,7 +416,7 @@ protected IEnumerator Move(Vector3 objectLocalDelta)
416416 }
417417 }
418418 }
419-
419+
420420 /// <summary>
421421 /// Called when the Unity UGUI element is selected.
422422 /// </summary>
You can’t perform that action at this time.
0 commit comments