Exemple #1
0
    public TextureHolder GenerateTextures(TexturesGenerationMode mode, int[] resolutions)
    {
        TextureHolder newTextureHolder = new TextureHolder();
        Color         mainColor        = Utils.GenerateRandomColor(Color.white);
        Color         secondColor      = Utils.GenerateRandomColor(mainColor);

        newTextureHolder.mainColor   = mainColor;
        newTextureHolder.secondColor = secondColor;
        switch (mode)
        {
        case TexturesGenerationMode.LinearRamp:
        {
            for (int i = 0; i < resolutions.Length; i++)
            {
                newTextureHolder.AddTexture(GetLinearRampTexture(resolutions[i], mainColor, secondColor));
            }
            break;
        }

        case TexturesGenerationMode.CircularRamp:
        {
            for (int i = 0; i < resolutions.Length; i++)
            {
                newTextureHolder.AddTexture(GetCircularRampTexture(resolutions[i], mainColor, secondColor));
            }
            break;
        }
        }
        return(newTextureHolder);
    }
    public static void GenerateNewTexturesSet()
    {
        singleton.curTexturesSet.Clear();
        TexturesGenerationMode curMode = TexturesGenerationMode.LinearRamp;

        for (int i = 0; i < ConfigDictionary.Config.countTexturesBySet; i++)
        {
            singleton.curTexturesSet.Add(singleton.textureGenerator.GenerateTextures(curMode, ConfigDictionary.Config.texturesResolutions));
            if (curMode == TexturesGenerationMode.LinearRamp)
            {
                curMode = TexturesGenerationMode.CircularRamp;
            }
            else
            {
                curMode = TexturesGenerationMode.LinearRamp;
            }
        }
    }