MeshLinesGenerator.GetFreeMeshLineIndex C# (CSharp) Méthode

GetFreeMeshLineIndex() private méthode

private GetFreeMeshLineIndex ( ) : int
Résultat int
    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;
    }