示例#1
0
    private ReelFaceCoords[] GetFaces()
    {
        int atlasSymbolsHorizontally = (int)(atlasSymbolsSize.x / symbolSideSize);
        int atlasSymbolsVertically   = (int)(atlasSymbolsSize.y / symbolSideSize);

        ReelFaceCoords[] ret = new ReelFaceCoords[atlasSymbolsHorizontally * atlasSymbolsVertically - emptySymbols];

        for (int i = 0; i < atlasSymbolsVertically; i++)
        {
            for (int j = 0; j < atlasSymbolsHorizontally; j++)
            {
                int currentIndex = i * atlasSymbolsHorizontally + j;
                if (currentIndex >= ret.Length)
                {
                    break;
                }

                ReelFaceCoords rfc = new ReelFaceCoords();

                rfc.v0 = new Vector2(atlasSymbolsOffset.x + j * symbolSideSize, 1 - (atlasSymbolsOffset.y + (i + 1) * symbolSideSize));
                rfc.v1 = new Vector2(atlasSymbolsOffset.x + (j + 1) * symbolSideSize, 1 - (atlasSymbolsOffset.y + i * symbolSideSize));
                rfc.v2 = new Vector2(atlasSymbolsOffset.x + (j + 1) * symbolSideSize, 1 - (atlasSymbolsOffset.y + (i + 1) * symbolSideSize));
                rfc.v3 = new Vector2(atlasSymbolsOffset.x + j * symbolSideSize, 1 - (atlasSymbolsOffset.y + i * symbolSideSize));

                ret [currentIndex] = rfc;
            }
        }

        return(ret);
    }
示例#2
0
    public void RandomizeReelUVs()
    {
        for (int i = 0; i < reelsUVs.Length; i++)
        {
            int randomIndex = Random.Range(0, reelsUVs.Length);

            ReelFaceCoords tempRFC = reelsUVs [i];
            reelsUVs [i]           = reelsUVs [randomIndex];
            reelsUVs [randomIndex] = tempRFC;
        }
    }