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.

22 lines
542 B

using UnityEngine;
using System.Collections;
using CharacterEngine.Primitives;
public class test : MonoBehaviour {
public BoxCollider2D coll;
protected CECollider ce;
// Use this for initialization
void Start () {
ce = new CECollider(coll);
}
// Update is called once per frame
void Update () {
if (ce.ContainsPoint(transform.position))
{
Vector2 p = CECollision.ClosestPointInBounds(ce, transform.position);
Debug.DrawLine(p, transform.position, Color.red);
}
}
}