This commit is contained in:
2025-05-13 05:19:58 +03:00
parent 853edaf0b4
commit 472b2aee18
1034 changed files with 41844 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ClosestPointDebug : MonoBehaviour {
public Collider2D collider;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnDrawGizmos() {
if (enabled) {
Vector2 pos = collider.offset + (Vector2)collider.transform.position;
Vector3 p = new Vector3(pos.x, pos.y, 0);
Gizmos.DrawLine(p, transform.position);
var closestPoint = collider.ClosestPointOnBounds(transform.position);
AdvancedGizmo.DrawCircle(new Vector3(closestPoint.x, closestPoint.y, 0), Vector3.forward, 0.1f, Color.red, 48);
}
}
}