Beispiel #1
0
    void OnTriggerStay2D(Collider2D col)
    {
        string tag = col.tag;

        colliderObject = (actual != tag) ? ColliderFactory(tag) : colliderObject;

        if (null != colliderObject)
        {
            colliderObject.IsColliding(col);
            actual = tag;
        }
    }
Beispiel #2
0
        internal bool ResolveOneCollision(ICollider collider, out Collision collision)
        {
            foreach (ICollider other in Space.GetAllItemsInRange(collider).Where(other => other != collider && other.Active && !other.Unphysical))
            {
                if (collider.IsColliding(other, out collision))
                {
                    return(true);
                }
            }

            collision = Collision.Empty;
            return(false);
        }