Esempio n. 1
0
    private void Update()
    {
        unCheckedObjs.AddRange(objs);

        foreach (CollisionHull2D otherObj in objs)
        {
            for (int i = 0; i < unCheckedObjs.Count; ++i)
            {
                CollisionHull2D currentObj = unCheckedObjs[i];

                if (currentObj.GetInstanceID() == otherObj.GetInstanceID())
                {
                    continue;
                }

                bool isColliding = CollisionHull2D.TestCollision(currentObj, otherObj);
                currentObj.SetColliding(isColliding, otherObj);
                //j.SetColliding(isColliding, i);
            }

            //unCheckedObjs.RemoveAt(0);
        }

        unCheckedObjs.Clear();
    }