void CheckTile(Vector3 positionToCheck) { Collider2D checkedTileCol = Physics2D.OverlapCircle(positionToCheck, 4, interactableTile); if (checkedTileCol) { InteractableTile it = checkedTileCol.gameObject.GetComponent <InteractableTile>(); it.ActivateInteraction(); } }
bool CheckTile(Vector3 positionToCheck) { Collider2D checkedTileCol = Physics2D.OverlapCircle(positionToCheck, 4, interactableTile); if (checkedTileCol && checkedTileCol.GetComponent <AirshipTile>() == null) { InteractableTile it = checkedTileCol.gameObject.GetComponent <InteractableTile>(); it.ActivateInteraction(); Debug.Log("interact" + checkedTileCol.gameObject.name); return(true); } return(false); }
bool CheckTile(Vector3 positionToCheck) { if (isLeader) { Collider2D checkedTileCol = Physics2D.OverlapCircle(positionToCheck, 4, interactableTile); if (checkedTileCol) { InteractableTile it = checkedTileCol.gameObject.GetComponent <InteractableTile>(); it.ActivateInteraction(); return(true); } } return(false); }