Ejemplo n.º 1
0
 public static ColorfulTextMaterial GetInstance(Blending blending, int styleIndex)
 {
     lock (instanceCache) {
         var instanceKey = GetInstanceKey(blending, styleIndex);
         ColorfulTextMaterial instance;
         if (!instanceCache.TryGetValue(instanceKey, out instance))
         {
             instance = new ColorfulTextMaterial(blending, styleIndex);
             instanceCache.Add(instanceKey, instance);
         }
         return(instance);
     }
 }
Ejemplo n.º 2
0
            public IMaterial GetMaterial(int tag)
            {
                var styleGradientMapIndex = gradientMapIndices[tag];

                if (material == null || gradientMapIndex != styleGradientMapIndex)
                {
                    gradientMapIndex = styleGradientMapIndex;
                    if (gradientMapIndex < 0)
                    {
                        material = WidgetMaterial.GetInstance(blending, shader, 1);
                    }
                    else
                    {
                        material = ColorfulTextMaterial.GetInstance(blending, gradientMapIndex);
                    }
                }
                return(material);
            }
Ejemplo n.º 3
0
 public void Init(Blending blending, int gradientMapIndex)
 {
     material = ColorfulTextMaterial.GetInstance(blending, gradientMapIndex);
 }