mirror of
https://github.com/BlackMATov/unity-iso-tools.git
synced 2025-12-16 22:16:55 +07:00
Fix Unity 5.6 warning
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
###### Version 3.1.0
|
||||||
|
|
||||||
|
* Fix Unity 5.6 warning
|
||||||
|
|
||||||
###### Version 3.0.2
|
###### Version 3.0.2
|
||||||
|
|
||||||
* Physics settings in IsoWorld inspector
|
* Physics settings in IsoWorld inspector
|
||||||
|
|||||||
@@ -249,29 +249,9 @@ namespace IsoTools.Internal {
|
|||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
|
|
||||||
public static Vector3 GizmoRectangle(Vector3 center) {
|
public static Vector3 GizmoRectangle(Vector3 center) {
|
||||||
Handles.color = new Color(
|
GizmoDotCap(new Color(1.0f, 1.0f, 1.0f, 0.3f) * Handles.zAxisColor, center, 0.15f);
|
||||||
Handles.zAxisColor.r,
|
GizmoArrowCap(Handles.zAxisColor, center, 1.0f);
|
||||||
Handles.zAxisColor.g,
|
return GizmoFreeMoveHandle(Handles.zAxisColor, center, 0.15f);
|
||||||
Handles.zAxisColor.b,
|
|
||||||
0.3f);
|
|
||||||
Handles.DotCap(
|
|
||||||
0,
|
|
||||||
center,
|
|
||||||
Quaternion.identity,
|
|
||||||
HandleUtility.GetHandleSize(center) * 0.15f);
|
|
||||||
Handles.color = Handles.zAxisColor;
|
|
||||||
Handles.ArrowCap(
|
|
||||||
0,
|
|
||||||
center,
|
|
||||||
Quaternion.identity,
|
|
||||||
HandleUtility.GetHandleSize(center));
|
|
||||||
Handles.color = Handles.zAxisColor;
|
|
||||||
return Handles.FreeMoveHandle(
|
|
||||||
center,
|
|
||||||
Quaternion.identity,
|
|
||||||
HandleUtility.GetHandleSize(center) * 0.15f,
|
|
||||||
Vector3.zero,
|
|
||||||
Handles.RectangleCap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3 GizmoSlider(Color color, Vector3 pos, Vector3 dir) {
|
public static Vector3 GizmoSlider(Color color, Vector3 pos, Vector3 dir) {
|
||||||
@@ -279,6 +259,60 @@ namespace IsoTools.Internal {
|
|||||||
return Handles.Slider(pos, dir);
|
return Handles.Slider(pos, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void GizmoDotCap(Color color, Vector3 center, float scale) {
|
||||||
|
Handles.color = color;
|
||||||
|
#if UNITY_5_6_OR_NEWER
|
||||||
|
Handles.DotHandleCap(
|
||||||
|
0,
|
||||||
|
center,
|
||||||
|
Quaternion.identity,
|
||||||
|
HandleUtility.GetHandleSize(center) * scale,
|
||||||
|
EventType.Repaint);
|
||||||
|
#else
|
||||||
|
Handles.DotCap(
|
||||||
|
0,
|
||||||
|
center,
|
||||||
|
Quaternion.identity,
|
||||||
|
HandleUtility.GetHandleSize(center) * scale);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GizmoArrowCap(Color color, Vector3 center, float scale) {
|
||||||
|
Handles.color = color;
|
||||||
|
#if UNITY_5_6_OR_NEWER
|
||||||
|
Handles.ArrowHandleCap(
|
||||||
|
0,
|
||||||
|
center,
|
||||||
|
Quaternion.identity,
|
||||||
|
HandleUtility.GetHandleSize(center) * scale,
|
||||||
|
EventType.Repaint);
|
||||||
|
#else
|
||||||
|
Handles.ArrowCap(
|
||||||
|
0,
|
||||||
|
center,
|
||||||
|
Quaternion.identity,
|
||||||
|
HandleUtility.GetHandleSize(center) * scale);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vector3 GizmoFreeMoveHandle(Color color, Vector3 center, float scale) {
|
||||||
|
#if UNITY_5_6_OR_NEWER
|
||||||
|
return Handles.FreeMoveHandle(
|
||||||
|
center,
|
||||||
|
Quaternion.identity,
|
||||||
|
HandleUtility.GetHandleSize(center) * scale,
|
||||||
|
Vector3.zero,
|
||||||
|
Handles.RectangleHandleCap);
|
||||||
|
#else
|
||||||
|
return Handles.FreeMoveHandle(
|
||||||
|
center,
|
||||||
|
Quaternion.identity,
|
||||||
|
HandleUtility.GetHandleSize(center) * scale,
|
||||||
|
Vector3.zero,
|
||||||
|
Handles.RectangleCap);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Snapping
|
// Snapping
|
||||||
|
|||||||
Reference in New Issue
Block a user