private static Vector3 DoPositionHandle_Internal(Vector3 position, Quaternion rotation) { float handleSize = RuntimeHandlesUtility.GetHandleSize(position); Color color = RuntimeHandles.color; bool flag = !Tools.s_Hidden; RuntimeHandles.color = ((!flag) ? xAxisColor : Color.Lerp(xAxisColor, staticColor, staticBlend)); GUI.SetNextControlName("xAxis"); position = Slider(position, rotation * Vector3.right, handleSize, ArrowCap, RuntimeSnapSettings.move.x); RuntimeHandles.color = ((!flag) ? yAxisColor : Color.Lerp(yAxisColor, staticColor, staticBlend)); GUI.SetNextControlName("yAxis"); position = Slider(position, rotation * Vector3.up, handleSize, ArrowCap, RuntimeSnapSettings.move.x); RuntimeHandles.color = ((!flag) ? zAxisColor : Color.Lerp(zAxisColor, staticColor, staticBlend)); GUI.SetNextControlName("zAxis"); position = Slider(position, rotation * Vector3.forward, handleSize, ArrowCap, RuntimeSnapSettings.move.x); position = DoPlanarHandle(PlaneHandle.xzPlane, position, rotation, handleSize * 0.25f); position = DoPlanarHandle(PlaneHandle.xyPlane, position, rotation, handleSize * 0.25f); position = DoPlanarHandle(PlaneHandle.yzPlane, position, rotation, handleSize * 0.25f); RuntimeHandles.color = color; return(position); }
public static Quaternion DoRotationHandle(Quaternion rotation, Vector3 position) { float handleSize = RuntimeHandlesUtility.GetHandleSize(position); Color color = RuntimeHandles.color; bool flag = !Tools.s_Hidden; RuntimeHandles.color = ((!flag) ? xAxisColor : Color.Lerp(xAxisColor, staticColor, staticBlend)); rotation = Disc(rotation, position, rotation * Vector3.right, handleSize, true, RuntimeSnapSettings.rotation); RuntimeHandles.color = ((!flag) ? yAxisColor : Color.Lerp(yAxisColor, staticColor, staticBlend)); rotation = Disc(rotation, position, rotation * Vector3.up, handleSize, true, RuntimeSnapSettings.rotation); RuntimeHandles.color = ((!flag) ? zAxisColor : Color.Lerp(zAxisColor, staticColor, staticBlend)); rotation = Disc(rotation, position, rotation * Vector3.forward, handleSize, true, RuntimeSnapSettings.rotation); if (!flag) { RuntimeHandles.color = centerColor; rotation = Disc(rotation, position, currentCamera.transform.forward, handleSize * 1.1f, false, 0f); //rotation = FreeRotateHandle(rotation, position, handleSize); } RuntimeHandles.color = color; return(rotation); }
public static void SetMinDragDifferenceForPos(Vector3 position) { minDragDifference = Vector3.one * (RuntimeHandlesUtility.GetHandleSize(position) / 80f); }
public static Vector3 DoScaleHandle(Vector3 scale, Vector3 position, Quaternion rotation) { return(DoScaleHandle(scale, position, rotation, RuntimeHandlesUtility.GetHandleSize(position))); }
public static Vector3 Slider(Vector3 position, Vector3 direction) { return(Slider(position, direction, RuntimeHandlesUtility.GetHandleSize(position), ArrowCap, -1f)); }