int CheckRightwards(Vector2 index, OrbType orbType) { if (index.x >= 0 && index.x < boardHorizontal) { GemBehaviour thisOrb = orbBoard[(int)index.x, (int)index.y]; if (thisOrb.GetOrbType() == orbType) { if (thisOrb != null) { potentialOrbs.Add(thisOrb); } return(1 + CheckRightwards(index + Vector2.right, orbType)); } } return(0); }
int CheckDownwards(Vector2 index, OrbType orbType) { if (index.y >= 0 && index.y < boardVertical) { GemBehaviour thisOrb = orbBoard[(int)index.x, (int)index.y]; if (thisOrb.GetOrbType() == orbType) { if (thisOrb != null) { potentialOrbs.Add(thisOrb); } return(1 + CheckDownwards(index + Vector2.down, orbType)); } } return(0); }