|
@@ -51,11 +51,11 @@ namespace KairoEngine.Utility
|
|
return worldPosition;
|
|
return worldPosition;
|
|
}
|
|
}
|
|
|
|
|
|
- public static Vector3 GetMouseWorldPosition(int mouseColliderLayerMask)
|
|
|
|
|
|
+ public static Vector3 GetMouseWorldPosition(int mouseColliderLayerMask, float distance = 999f)
|
|
{
|
|
{
|
|
if(Camera.main == null) return new Vector3();
|
|
if(Camera.main == null) return new Vector3();
|
|
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
|
|
- if(Physics.Raycast(ray, out RaycastHit raycastHit, 999f, mouseColliderLayerMask))
|
|
|
|
|
|
+ if(Physics.Raycast(ray, out RaycastHit raycastHit, distance, mouseColliderLayerMask))
|
|
{
|
|
{
|
|
return raycastHit.point;
|
|
return raycastHit.point;
|
|
}
|
|
}
|
|
@@ -147,6 +147,14 @@ namespace KairoEngine.Utility
|
|
}
|
|
}
|
|
return points;
|
|
return points;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public static float SuperLerp(float from, float to, float from2, float to2, float value) {
|
|
|
|
+ if (value <= from2)
|
|
|
|
+ return from;
|
|
|
|
+ else if (value >= to2)
|
|
|
|
+ return to;
|
|
|
|
+ return (to - from) * ((value - from2) / (to2 - from2)) + from;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|