void OnTriggerEnter2D(Collider2D coll)
{
//Only allies can activate
if (coll.gameObject.tag == "Ally")
{
//Character is holding an item
if (coll.gameObject.transform.childCount == 1)
{
//Check if item is correct key
if (coll.gameObject.GetComponentInChildren<Key>().Identifier == this.Identifier)
{
myRenderer.sprite = openSprite;
myCollider.enabled = false;
Destroy(coll.gameObject.transform.GetChild(0).gameObject);
}
}
}
}
}