protected virtual bool HandleObstruction(GameObject other) { Obstruction obstruction = other.GetComponent <Obstruction>(); if (obstruction != null) { return(false); } return(true); }
//when colliding with wall or door protected override bool HandleObstruction(GameObject other) { Obstruction obstruction = other.GetComponent <Obstruction>(); if (obstruction != null) { if (obstruction.canBeOpened) { if (keys > 0) { keys--; Destroy(other); return(true); } } return(false); } return(true); }