66 * $Notice: See LICENSE.txt for modification and distribution information
77 * Copyright (c) 2017 by Shen, Jen-Chieh $
88 */
9+ using Unity . Mathematics ;
910using UnityEngine ;
1011using MyBox ;
1112
@@ -46,25 +47,25 @@ public class JCS_FreezeTransformAction : JCS_UnityObject
4647
4748 [ Tooltip ( "Freeze the position in each axis." ) ]
4849 [ SerializeField ]
49- private JCS_Bool3 mFreezePosition = JCS_Bool3 . allFalse ;
50+ private bool3 mFreezePosition = default ;
5051
5152 [ Tooltip ( "Freeze the rotation in each axis." ) ]
5253 [ SerializeField ]
53- private JCS_Bool3 mFreezeRotation = JCS_Bool3 . allFalse ;
54+ private bool3 mFreezeRotation = default ;
5455
5556 [ Tooltip ( "Freeze the scale in each axis." ) ]
5657 [ SerializeField ]
57- private JCS_Bool3 mFreezeScale = JCS_Bool3 . allFalse ;
58+ private bool3 mFreezeScale = default ;
5859
5960 /* Setter & Getter */
6061
6162 public bool active { get { return mActive ; } set { mActive = value ; } }
6263 public Vector3 positionToFreeze { get { return mPositionToFreeze ; } set { mPositionToFreeze = value ; } }
6364 public Vector3 rotationToFreeze { get { return mRotationToFreeze ; } set { mRotationToFreeze = value ; } }
6465 public Vector3 scaleToFreeze { get { return mScaleToFreeze ; } set { mScaleToFreeze = value ; } }
65- public JCS_Bool3 freezePosition { get { return mFreezePosition ; } set { mFreezePosition = value ; } }
66- public JCS_Bool3 freezeRotation { get { return mFreezeRotation ; } set { mFreezeRotation = value ; } }
67- public JCS_Bool3 freezeScale { get { return mFreezeScale ; } set { mFreezeScale = value ; } }
66+ public bool3 freezePosition { get { return mFreezePosition ; } set { mFreezePosition = value ; } }
67+ public bool3 freezeRotation { get { return mFreezeRotation ; } set { mFreezeRotation = value ; } }
68+ public bool3 freezeScale { get { return mFreezeScale ; } set { mFreezeScale = value ; } }
6869 public bool isLocalPosition
6970 {
7071 get { return mIsLocalPosition ; }
@@ -140,11 +141,11 @@ private void DoFreezePosition()
140141 newPos = localPosition ;
141142
142143 /* Freeze position */
143- if ( mFreezePosition . check1 )
144+ if ( mFreezePosition . x )
144145 newPos . x = mPositionToFreeze . x ;
145- if ( mFreezePosition . check2 )
146+ if ( mFreezePosition . y )
146147 newPos . y = mPositionToFreeze . y ;
147- if ( mFreezePosition . check3 )
148+ if ( mFreezePosition . z )
148149 newPos . z = mPositionToFreeze . z ;
149150
150151 /* Apply new value to transform. */
@@ -164,11 +165,11 @@ private void DoFreezeRotation()
164165 newRot = localEulerAngles ;
165166
166167 /* Freeze euler angles */
167- if ( mFreezeRotation . check1 )
168+ if ( mFreezeRotation . x )
168169 newRot . x = mRotationToFreeze . x ;
169- if ( mFreezeRotation . check2 )
170+ if ( mFreezeRotation . y )
170171 newRot . y = mRotationToFreeze . y ;
171- if ( mFreezeRotation . check3 )
172+ if ( mFreezeRotation . z )
172173 newRot . z = mRotationToFreeze . z ;
173174
174175 if ( mIsLocalRotation )
@@ -185,11 +186,11 @@ private void DoFreezeScale()
185186 Vector3 newScale = localScale ;
186187
187188 /* Freeze scale */
188- if ( mFreezeScale . check1 )
189+ if ( mFreezeScale . x )
189190 newScale . x = mScaleToFreeze . x ;
190- if ( mFreezeScale . check2 )
191+ if ( mFreezeScale . y )
191192 newScale . y = mScaleToFreeze . y ;
192- if ( mFreezeScale . check3 )
193+ if ( mFreezeScale . z )
193194 newScale . z = mScaleToFreeze . z ;
194195
195196 localScale = newScale ;
0 commit comments