@@ -100,17 +100,17 @@ public class JCS_TouchInput : JCS_Instance<JCS_TouchInput>
100100
101101 /* Setter & Getter */
102102
103- public bool Touched { get { return this . mTouched ; } }
104- public Vector2 DeltaPos { get { return this . mDeltaPos ; } }
105- public Vector2 DragDistance { get { return this . mDragDistance ; } }
106- public Vector2 DragDisplacement { get { return this . mDragDisplacement ; } }
107- public bool Dragging { get { return this . mDragging ; } }
108- public float TouchTime { get { return this . mTouchTime ; } }
103+ public bool touched { get { return this . mTouched ; } }
104+ public Vector2 deltaPos { get { return this . mDeltaPos ; } }
105+ public Vector2 dragDistance { get { return this . mDragDistance ; } }
106+ public Vector2 dragDisplacement { get { return this . mDragDisplacement ; } }
107+ public bool dragging { get { return this . mDragging ; } }
108+ public float touchTime { get { return this . mTouchTime ; } }
109109#if ( UNITY_ANDROID || UNITY_IPHIONE || UNITY_IOS )
110- public bool MultiTouch { get { return this . mMultiTouch ; } }
111- public float TouchDistance { get { return this . mTouchDistance ; } }
112- public float TouchDistanceDelta { get { return this . mTouchDistanceDelta ; } }
113- public int DetectTouchCount { get { return this . mDetectTouchCount ; } set { this . mDetectTouchCount = value ; } }
110+ public bool multiTouch { get { return this . mMultiTouch ; } }
111+ public float touchDistance { get { return this . mTouchDistance ; } }
112+ public float touchDistanceDelta { get { return this . mTouchDistanceDelta ; } }
113+ public int detectTouchCount { get { return this . mDetectTouchCount ; } set { this . mDetectTouchCount = value ; } }
114114#else
115115 public JCS_MouseButton MouseType { get { return this . mMouseType ; } set { this . mMouseType = value ; } }
116116#endif
@@ -176,21 +176,29 @@ private void WhenTouched()
176176
177177 if ( mDeltaPos == Vector2 . zero && mDragDistance == Vector2 . zero )
178178 {
179- this . mDragStartPosition = currPos ;
179+ mDragStartPosition = currPos ;
180180 }
181181 else
182182 {
183- this . mDragging = true ;
183+ mDragging = true ;
184184 Vector2 dragEndPosition = currPos ;
185185
186- this . mDragDistance . x = JCS_Mathf . DistanceOfUnitVector ( mDragStartPosition . x , dragEndPosition . x ) ;
187- this . mDragDistance . y = JCS_Mathf . DistanceOfUnitVector ( mDragStartPosition . y , dragEndPosition . y ) ;
186+ mDragDistance . x = JCS_Mathf . DistanceOfUnitVector ( mDragStartPosition . x , dragEndPosition . x ) ;
187+ mDragDistance . y = JCS_Mathf . DistanceOfUnitVector ( mDragStartPosition . y , dragEndPosition . y ) ;
188+
189+ // 標準視窗的變動係數.
190+ {
191+ float scaleFactor = JCS_Canvas . SCALE_FACTOR ;
192+
193+ mDragDistance . x /= scaleFactor ;
194+ mDragDistance . y /= scaleFactor ;
195+ }
188196
189197 float xDiff = dragEndPosition . x - mDragStartPosition . x ;
190198 float yDiff = dragEndPosition . y - mDragStartPosition . y ;
191199
192- this . mDragDisplacement . x = mDragDistance . x * JCS_Mathf . GetSign ( xDiff ) ;
193- this . mDragDisplacement . y = mDragDistance . y * JCS_Mathf . GetSign ( yDiff ) ;
200+ mDragDisplacement . x = mDragDistance . x * JCS_Mathf . GetSign ( xDiff ) ;
201+ mDragDisplacement . y = mDragDistance . y * JCS_Mathf . GetSign ( yDiff ) ;
194202 }
195203
196204#if ( UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL )
0 commit comments