Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SkeletonView.cs 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. using UnityEngine;
  2. namespace UnityEditor.U2D.Animation
  3. {
  4. internal class SkeletonView : ISkeletonView
  5. {
  6. internal const string deleteCommandName = "Delete";
  7. internal const string softDeleteCommandName = "SoftDelete";
  8. const float k_PickingRadius = 5f;
  9. static readonly int k_BodyHashCode = "Body".GetHashCode();
  10. static readonly int k_JointHashCode = "Joint".GetHashCode();
  11. static readonly int k_TailHashCode = "Tail".GetHashCode();
  12. static readonly int k_CreateBoneHashCode = "CreateBone".GetHashCode();
  13. public int InvalidID { get; set; }
  14. public SkeletonMode mode { get; set; }
  15. public int defaultControlID { get; set; }
  16. public int hoveredBoneID => m_HoveredBoneID;
  17. public int hoveredJointID => m_HoveredJointID;
  18. public int hoveredBodyID => m_HoveredBodyID;
  19. public int hoveredTailID => m_HoveredTailID;
  20. public int hotBoneID => m_HotBoneID;
  21. IGUIWrapper m_GUIWrapper;
  22. int m_RotateControlID = -1;
  23. int m_MoveControlID = -1;
  24. int m_FreeMoveControlID = -1;
  25. int m_MoveJointControlID = -1;
  26. int m_MoveEndPositionControlID = -1;
  27. int m_ChangeLengthControlID = -1;
  28. int m_CreateBoneControlID = -1;
  29. int m_HoveredBoneID = 0;
  30. int m_PrevHoveredBoneID = 0;
  31. int m_HoveredBodyID = 0;
  32. int m_HoveredJointID = 0;
  33. int m_HoveredTailID = 0;
  34. int m_HotBoneID = 0;
  35. int m_HoveredBodyControlID = -1;
  36. int m_HoveredJointControlID = -1;
  37. int m_HoveredTailControlID = -1;
  38. float m_NearestDistance;
  39. float m_NearestBodyDistance;
  40. float m_NearestJointDistance;
  41. float m_NearestTailDistance;
  42. int m_NearestBodyId = 0;
  43. int m_NearestJointId = 0;
  44. int m_NearestTailId = 0;
  45. SliderData m_HoveredSliderData = SliderData.zero;
  46. SliderData m_HotSliderData = SliderData.zero;
  47. public SkeletonView(IGUIWrapper gw)
  48. {
  49. m_GUIWrapper = gw;
  50. }
  51. public void BeginLayout()
  52. {
  53. m_HoveredBodyControlID = m_GUIWrapper.GetControlID(k_BodyHashCode, FocusType.Passive);
  54. m_HoveredJointControlID = m_GUIWrapper.GetControlID(k_JointHashCode, FocusType.Passive);
  55. m_HoveredTailControlID = m_GUIWrapper.GetControlID(k_TailHashCode, FocusType.Passive);
  56. m_CreateBoneControlID = m_GUIWrapper.GetControlID(k_CreateBoneHashCode, FocusType.Passive);
  57. if (m_GUIWrapper.eventType == EventType.Layout)
  58. {
  59. m_PrevHoveredBoneID = m_HoveredBoneID;
  60. m_NearestDistance = float.MaxValue;
  61. m_NearestBodyDistance = float.MaxValue;
  62. m_NearestJointDistance = float.MaxValue;
  63. m_NearestTailDistance = float.MaxValue;
  64. m_NearestBodyId = InvalidID;
  65. m_NearestJointId = InvalidID;
  66. m_NearestTailId = InvalidID;
  67. m_HoveredBoneID = InvalidID;
  68. m_HoveredBodyID = InvalidID;
  69. m_HoveredJointID = InvalidID;
  70. m_HoveredTailID = InvalidID;
  71. m_HoveredSliderData = SliderData.zero;
  72. if (m_GUIWrapper.IsControlHot(0))
  73. {
  74. m_RotateControlID = -1;
  75. m_MoveControlID = -1;
  76. m_FreeMoveControlID = -1;
  77. m_MoveJointControlID = -1;
  78. m_MoveEndPositionControlID = -1;
  79. m_ChangeLengthControlID = -1;
  80. m_HotBoneID = InvalidID;
  81. }
  82. }
  83. }
  84. public void EndLayout()
  85. {
  86. m_GUIWrapper.LayoutControl(m_HoveredBodyControlID, m_NearestBodyDistance * 0.25f);
  87. m_GUIWrapper.LayoutControl(m_HoveredJointControlID, m_NearestJointDistance);
  88. m_GUIWrapper.LayoutControl(m_HoveredTailControlID, m_NearestTailDistance);
  89. if (m_GUIWrapper.IsControlNearest(m_HoveredBodyControlID))
  90. {
  91. m_HoveredBoneID = m_NearestBodyId;
  92. m_HoveredBodyID = m_NearestBodyId;
  93. }
  94. if (m_GUIWrapper.IsControlNearest(m_HoveredJointControlID))
  95. {
  96. m_HoveredBoneID = m_NearestJointId;
  97. m_HoveredJointID = m_NearestJointId;
  98. }
  99. if (m_GUIWrapper.IsControlNearest(m_HoveredTailControlID))
  100. {
  101. m_HoveredBoneID = m_NearestTailId;
  102. m_HoveredTailID = m_NearestTailId;
  103. }
  104. if ((m_GUIWrapper.eventType == EventType.Layout && m_PrevHoveredBoneID != m_HoveredBoneID) || m_GUIWrapper.eventType == EventType.MouseMove)
  105. m_GUIWrapper.Repaint();
  106. }
  107. public bool CanLayout()
  108. {
  109. return m_GUIWrapper.eventType == EventType.Layout;
  110. }
  111. public void LayoutBone(int id, Vector3 position, Vector3 endPosition, Vector3 forward, Vector3 up, Vector3 right, bool isChainEnd)
  112. {
  113. if (mode == SkeletonMode.Disabled)
  114. return;
  115. var sliderData = new SliderData()
  116. {
  117. position = GetMouseWorldPosition(forward, position),
  118. forward = forward,
  119. up = up,
  120. right = right
  121. };
  122. {
  123. var distance = m_GUIWrapper.DistanceToSegmentClamp(position, endPosition);
  124. if (distance <= m_NearestDistance)
  125. {
  126. m_NearestDistance = distance;
  127. m_NearestBodyDistance = distance;
  128. m_NearestBodyId = id;
  129. m_HoveredSliderData = sliderData;
  130. }
  131. }
  132. {
  133. var distance = m_GUIWrapper.DistanceToCircle(position, GetBoneRadiusForPicking(position) * 2f);
  134. if (distance <= m_NearestDistance)
  135. {
  136. m_NearestDistance = distance;
  137. m_NearestJointDistance = distance;
  138. m_NearestJointId = id;
  139. m_HoveredSliderData = sliderData;
  140. }
  141. }
  142. if (isChainEnd &&
  143. (IsCapable(SkeletonAction.ChangeLength) ||
  144. IsCapable(SkeletonAction.MoveEndPosition) ||
  145. IsCapable(SkeletonAction.CreateBone)))
  146. {
  147. var distance = m_GUIWrapper.DistanceToCircle(endPosition, GetBoneRadiusForPicking(endPosition));
  148. if (distance <= m_NearestDistance)
  149. {
  150. m_NearestDistance = distance;
  151. m_NearestTailDistance = distance;
  152. m_NearestTailId = id;
  153. m_HoveredSliderData = sliderData;
  154. }
  155. }
  156. }
  157. public Vector3 GetMouseWorldPosition(Vector3 planeNormal, Vector3 planePosition)
  158. {
  159. return m_GUIWrapper.GUIToWorld(m_GUIWrapper.mousePosition, planeNormal, planePosition);
  160. }
  161. float GetBoneRadiusForPicking(Vector3 position)
  162. {
  163. if (m_GUIWrapper.HasCurrentCamera())
  164. return 0.1f * m_GUIWrapper.GetHandleSize(position);
  165. return k_PickingRadius;
  166. }
  167. public bool DoSelectBone(out int id, out bool additive)
  168. {
  169. id = 0;
  170. additive = false;
  171. if (IsActionTriggering(SkeletonAction.Select))
  172. {
  173. id = m_HoveredBoneID;
  174. additive = m_GUIWrapper.isActionKeyDown;
  175. if (mode == SkeletonMode.Selection)
  176. {
  177. m_GUIWrapper.UseCurrentEvent();
  178. m_GUIWrapper.SetGuiChanged(true);
  179. }
  180. return true;
  181. }
  182. return false;
  183. }
  184. public bool DoRotateBone(Vector3 pivot, Vector3 normal, out float deltaAngle)
  185. {
  186. deltaAngle = 0f;
  187. var oldPosition = m_HotSliderData.position;
  188. if (DoSliderAction(SkeletonAction.RotateBone, m_HoveredBodyControlID, ref m_RotateControlID, out var newPosition))
  189. {
  190. deltaAngle = Vector3.SignedAngle(oldPosition - pivot, (Vector3)newPosition - pivot, normal);
  191. return true;
  192. }
  193. return false;
  194. }
  195. public bool DoMoveBone(out Vector3 deltaPosition)
  196. {
  197. deltaPosition = Vector3.zero;
  198. var oldPosition = m_HotSliderData.position;
  199. if (DoSliderAction(SkeletonAction.MoveBone, m_HoveredJointControlID, ref m_MoveControlID, out var newPosition))
  200. {
  201. deltaPosition = newPosition - oldPosition;
  202. return true;
  203. }
  204. return false;
  205. }
  206. public bool DoFreeMoveBone(out Vector3 deltaPosition)
  207. {
  208. deltaPosition = Vector3.zero;
  209. var oldPosition = m_HotSliderData.position;
  210. if (DoSliderAction(SkeletonAction.FreeMoveBone, m_HoveredBodyControlID, ref m_FreeMoveControlID, out var newPosition))
  211. {
  212. deltaPosition = newPosition - oldPosition;
  213. return true;
  214. }
  215. return false;
  216. }
  217. public bool DoMoveJoint(out Vector3 deltaPosition)
  218. {
  219. deltaPosition = Vector3.zero;
  220. var oldPosition = m_HotSliderData.position;
  221. if (DoSliderAction(SkeletonAction.MoveJoint, m_HoveredJointControlID, ref m_MoveJointControlID, out var newPosition))
  222. {
  223. deltaPosition = newPosition - oldPosition;
  224. return true;
  225. }
  226. return false;
  227. }
  228. public bool DoMoveEndPosition(out Vector3 endPosition)
  229. {
  230. return DoSliderAction(SkeletonAction.MoveEndPosition, m_HoveredTailControlID, ref m_MoveEndPositionControlID, out endPosition);
  231. }
  232. public bool DoChangeLength(out Vector3 endPosition)
  233. {
  234. return DoSliderAction(SkeletonAction.ChangeLength, m_HoveredTailControlID, ref m_ChangeLengthControlID, out endPosition);
  235. }
  236. bool DoSliderAction(SkeletonAction action, int controlID, ref int actionControlID, out Vector3 newPosition)
  237. {
  238. newPosition = m_HoveredSliderData.position;
  239. if (IsActionTriggering(action))
  240. {
  241. actionControlID = controlID;
  242. m_HotSliderData = m_HoveredSliderData;
  243. m_HotBoneID = hoveredBoneID;
  244. }
  245. if (m_GUIWrapper.DoSlider(actionControlID, m_HotSliderData, out newPosition))
  246. {
  247. m_HotSliderData.position = newPosition;
  248. return true;
  249. }
  250. return false;
  251. }
  252. public bool DoCreateBoneStart(out Vector3 position)
  253. {
  254. position = GetMouseWorldPosition(m_HoveredSliderData.forward, m_HoveredSliderData.position);
  255. if (CanCreateBone())
  256. m_GUIWrapper.LayoutControl(m_CreateBoneControlID, 0f);
  257. if (IsActionActive(SkeletonAction.CreateBone))
  258. ConsumeMouseMoveEvents();
  259. if (IsActionTriggering(SkeletonAction.CreateBone))
  260. {
  261. m_HotBoneID = hoveredBoneID;
  262. m_GUIWrapper.SetMultiStepControlHot(m_CreateBoneControlID);
  263. m_GUIWrapper.UseCurrentEvent();
  264. return true;
  265. }
  266. return false;
  267. }
  268. public bool CanCreateBone()
  269. {
  270. return mode == SkeletonMode.CreateBone && (m_GUIWrapper.IsControlNearest(defaultControlID) || m_GUIWrapper.IsControlNearest(m_HoveredTailControlID));
  271. }
  272. public bool DoCreateBone(out Vector3 position)
  273. {
  274. position = GetMouseWorldPosition(m_HoveredSliderData.forward, m_HoveredSliderData.position);
  275. if (IsActionHot(SkeletonAction.CreateBone))
  276. ConsumeMouseMoveEvents();
  277. if (IsActionFinishing(SkeletonAction.CreateBone))
  278. {
  279. m_GUIWrapper.UseCurrentEvent();
  280. m_GUIWrapper.SetGuiChanged(true);
  281. return true;
  282. }
  283. return false;
  284. }
  285. public bool DoSplitBone(out int id, out Vector3 position)
  286. {
  287. id = m_HoveredBodyID;
  288. position = GetMouseWorldPosition(m_HoveredSliderData.forward, m_HoveredSliderData.position);
  289. if (IsActionActive(SkeletonAction.SplitBone))
  290. ConsumeMouseMoveEvents();
  291. if (IsActionTriggering(SkeletonAction.SplitBone))
  292. {
  293. m_GUIWrapper.UseCurrentEvent();
  294. m_GUIWrapper.SetGuiChanged(true);
  295. return true;
  296. }
  297. return false;
  298. }
  299. public bool DoRemoveBone()
  300. {
  301. if (IsActionTriggering(SkeletonAction.Remove))
  302. {
  303. m_GUIWrapper.UseCurrentEvent();
  304. m_GUIWrapper.SetGuiChanged(true);
  305. return true;
  306. }
  307. return false;
  308. }
  309. public bool DoCancelMultistepAction(bool force)
  310. {
  311. if (force)
  312. {
  313. m_GUIWrapper.SetMultiStepControlHot(0);
  314. return true;
  315. }
  316. if ((!m_GUIWrapper.IsMultiStepControlHot(0) && (m_GUIWrapper.IsMouseDown(1) || m_GUIWrapper.IsKeyDown(KeyCode.Escape))))
  317. {
  318. m_GUIWrapper.SetMultiStepControlHot(0);
  319. m_GUIWrapper.UseCurrentEvent();
  320. return true;
  321. }
  322. return false;
  323. }
  324. public bool IsActionActive(SkeletonAction action)
  325. {
  326. if (m_GUIWrapper.isAltDown || !m_GUIWrapper.IsControlHot(0) || !m_GUIWrapper.IsMultiStepControlHot(0))
  327. return false;
  328. if (action == SkeletonAction.None)
  329. return m_GUIWrapper.IsControlNearest(defaultControlID);
  330. if (!IsCapable(action))
  331. return false;
  332. if (action == SkeletonAction.RotateBone)
  333. return m_GUIWrapper.IsControlNearest(m_HoveredBodyControlID);
  334. if (action == SkeletonAction.ChangeLength)
  335. return m_GUIWrapper.IsControlNearest(m_HoveredTailControlID) && !m_GUIWrapper.isShiftDown;
  336. if (action == SkeletonAction.MoveJoint)
  337. return m_GUIWrapper.IsControlNearest(m_HoveredJointControlID);
  338. if (action == SkeletonAction.MoveEndPosition)
  339. return m_GUIWrapper.IsControlNearest(m_HoveredTailControlID) && !m_GUIWrapper.isShiftDown;
  340. if (action == SkeletonAction.FreeMoveBone)
  341. return m_GUIWrapper.IsControlNearest(m_HoveredBodyControlID);
  342. if (action == SkeletonAction.MoveBone)
  343. return m_GUIWrapper.IsControlNearest(m_HoveredJointControlID);
  344. bool canCreateBone = IsCapable(SkeletonAction.CreateBone) && m_GUIWrapper.IsControlNearest(m_CreateBoneControlID);
  345. bool canSplitBone = IsCapable(SkeletonAction.SplitBone) && m_GUIWrapper.IsControlNearest(m_HoveredBodyControlID);
  346. if (action == SkeletonAction.CreateBone)
  347. return canCreateBone;
  348. if (action == SkeletonAction.SplitBone)
  349. return canSplitBone;
  350. if (action == SkeletonAction.Select)
  351. return (m_GUIWrapper.IsControlNearest(m_HoveredBodyControlID) && !canSplitBone) ||
  352. m_GUIWrapper.IsControlNearest(m_HoveredJointControlID) ||
  353. (m_GUIWrapper.IsControlNearest(m_HoveredTailControlID) && !canCreateBone);
  354. if (action == SkeletonAction.Remove)
  355. return true;
  356. return false;
  357. }
  358. public bool IsActionHot(SkeletonAction action)
  359. {
  360. if (action == SkeletonAction.None)
  361. return m_GUIWrapper.IsControlHot(0) && m_GUIWrapper.IsMultiStepControlHot(0);
  362. if (action == SkeletonAction.RotateBone)
  363. return m_GUIWrapper.IsControlHot(m_RotateControlID);
  364. if (action == SkeletonAction.MoveBone)
  365. return m_GUIWrapper.IsControlHot(m_MoveControlID);
  366. if (action == SkeletonAction.FreeMoveBone)
  367. return m_GUIWrapper.IsControlHot(m_FreeMoveControlID);
  368. if (action == SkeletonAction.MoveJoint)
  369. return m_GUIWrapper.IsControlHot(m_MoveJointControlID);
  370. if (action == SkeletonAction.MoveEndPosition)
  371. return m_GUIWrapper.IsControlHot(m_MoveEndPositionControlID);
  372. if (action == SkeletonAction.ChangeLength)
  373. return m_GUIWrapper.IsControlHot(m_ChangeLengthControlID);
  374. if (action == SkeletonAction.CreateBone)
  375. return m_GUIWrapper.IsMultiStepControlHot(m_CreateBoneControlID) && !m_GUIWrapper.isAltDown;
  376. return false;
  377. }
  378. public bool IsActionTriggering(SkeletonAction action)
  379. {
  380. if (!IsActionActive(action))
  381. return false;
  382. if (action == SkeletonAction.Remove)
  383. {
  384. if ((m_GUIWrapper.eventType == EventType.ValidateCommand || m_GUIWrapper.eventType == EventType.ExecuteCommand)
  385. && (m_GUIWrapper.commandName == softDeleteCommandName || m_GUIWrapper.commandName == deleteCommandName))
  386. {
  387. if (m_GUIWrapper.eventType == EventType.ExecuteCommand)
  388. return true;
  389. m_GUIWrapper.UseCurrentEvent();
  390. }
  391. return false;
  392. }
  393. return m_GUIWrapper.IsMouseDown(0);
  394. }
  395. public bool IsActionFinishing(SkeletonAction action)
  396. {
  397. if (!IsActionHot(action) || !IsCapable(action))
  398. return false;
  399. if (m_GUIWrapper.IsEventOutsideWindow())
  400. return true;
  401. if (action == SkeletonAction.CreateBone)
  402. return m_GUIWrapper.IsMouseDown(0);
  403. return m_GUIWrapper.IsMouseUp(0);
  404. }
  405. public bool IsRepainting()
  406. {
  407. return m_GUIWrapper.IsRepainting();
  408. }
  409. public void DrawBone(Vector3 position, Vector3 right, Vector3 forward, float length, Color color, bool isChained, bool isSelected, bool isJointHovered, bool isTailHovered, bool isHot)
  410. {
  411. var endPosition = position + right * length;
  412. var rotation = Quaternion.LookRotation(forward, Vector3.Cross(right, forward));
  413. var boneJointColor = new Color(0f, 0f, 0f, 0.75f * color.a);
  414. var tailColor = new Color(0f, 0f, 0f, 0.75f * color.a);
  415. var hoveredColor = Handles.preselectionColor;
  416. var selectedColor = Handles.selectedColor;
  417. var drawRectCap = false;
  418. if (isJointHovered)
  419. boneJointColor = hoveredColor;
  420. if (isHot && (IsActionHot(SkeletonAction.MoveBone) || IsActionHot(SkeletonAction.MoveJoint)))
  421. boneJointColor = selectedColor;
  422. if (mode == SkeletonMode.EditPose || mode == SkeletonMode.CreateBone)
  423. {
  424. if (isJointHovered || isSelected)
  425. drawRectCap = true;
  426. }
  427. else if (mode == SkeletonMode.EditJoints || mode == SkeletonMode.SplitBone)
  428. {
  429. rotation = Quaternion.identity;
  430. drawRectCap = true;
  431. }
  432. if (drawRectCap)
  433. Handles.RectangleHandleCap(0, position, rotation, BoneDrawingUtility.GetBoneRadius(position), EventType.Repaint);
  434. BoneDrawingUtility.DrawBone(position, endPosition, forward, color);
  435. BoneDrawingUtility.DrawBoneNode(position, forward, boneJointColor);
  436. if (!isChained &&
  437. (IsCapable(SkeletonAction.ChangeLength) ||
  438. IsCapable(SkeletonAction.MoveEndPosition)))
  439. {
  440. if (isTailHovered)
  441. tailColor = hoveredColor;
  442. if (isHot && (IsActionHot(SkeletonAction.ChangeLength) || IsActionHot(SkeletonAction.MoveEndPosition)))
  443. tailColor = selectedColor;
  444. BoneDrawingUtility.DrawBoneNode(endPosition, forward, tailColor);
  445. }
  446. }
  447. public void DrawBoneParentLink(Vector3 parentPosition, Vector3 position, Vector3 forward, Color color)
  448. {
  449. BoneDrawingUtility.DrawBone(position, parentPosition, forward, color);
  450. }
  451. public void DrawBoneOutline(Vector3 position, Vector3 right, Vector3 forward, float length, Color color, float outlineScale)
  452. {
  453. BoneDrawingUtility.DrawBoneOutline(position, position + right * length, forward, color, outlineScale);
  454. }
  455. public void DrawCursors(bool canBeActive)
  456. {
  457. var mouseScreenRect = new Rect(m_GUIWrapper.mousePosition.x - 100f, m_GUIWrapper.mousePosition.y - 100f, 200f, 200f);
  458. var isRotateHot = IsActionHot(SkeletonAction.RotateBone);
  459. if ((canBeActive && IsActionActive(SkeletonAction.RotateBone)) || isRotateHot)
  460. EditorGUIUtility.AddCursorRect(mouseScreenRect, MouseCursor.RotateArrow);
  461. if ((canBeActive && IsActionActive(SkeletonAction.MoveBone)) || IsActionHot(SkeletonAction.MoveBone) ||
  462. (canBeActive && IsActionActive(SkeletonAction.FreeMoveBone)) || IsActionHot(SkeletonAction.FreeMoveBone) ||
  463. (canBeActive && IsActionActive(SkeletonAction.MoveJoint)) || IsActionHot(SkeletonAction.MoveJoint) ||
  464. (canBeActive && IsActionActive(SkeletonAction.MoveEndPosition)) || IsActionHot(SkeletonAction.MoveEndPosition))
  465. EditorGUIUtility.AddCursorRect(mouseScreenRect, MouseCursor.MoveArrow);
  466. }
  467. void ConsumeMouseMoveEvents()
  468. {
  469. if (m_GUIWrapper.eventType == EventType.MouseMove || (m_GUIWrapper.eventType == EventType.MouseDrag && m_GUIWrapper.mouseButton == 0))
  470. m_GUIWrapper.UseCurrentEvent();
  471. }
  472. bool IsCapable(SkeletonAction action)
  473. {
  474. return ((int)mode & (int)action) != 0;
  475. }
  476. }
  477. }