int GetFreeMeshLineIndex()
{
for(int i = currentMeshlineFetchIndex; i < meshLinesPoolArray.Length + currentMeshlineFetchIndex; i++)
{
int newIndex = i % meshLinesPoolArray.Length;
if(meshLinesPoolArray[newIndex].activeSelf == false)
{
currentMeshlineFetchIndex = newIndex;
return newIndex;
}
}
// if nothing found
return -1;
}