public static ColorfulTextShaderProgram GetInstance() { if (instance == null) { instance = new ColorfulTextShaderProgram(); } return(instance); }
public static ColorfulTextShaderProgram GetShaderProgram(int styleIndex) { if (cachedShaderPrograms[styleIndex] == null) { cachedShaderPrograms[styleIndex] = new ColorfulTextShaderProgram { ColorIndex = (styleIndex * 2 + 1) / (GradientMapTextureSize * 2.0f) }; } return(cachedShaderPrograms[styleIndex]); }