Ejemplo n.º 1
0
    /// <summary>
    /// Sent when another object leaves a trigger collider attached to
    /// this object (2D physics only).
    /// </summary>
    /// <param name="other">The other Collider2D involved in this collision.</param>
    void OnTriggerExit2D(Collider2D other)
    {
        ObjectController2D obj = other.GetComponent <ObjectController2D>();

        if (obj && objs.Contains(obj))
        {
            objs.Remove(obj);
            obj.ApplyForce(speed);
        }
    }