Esempio 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);
     }
 }
Esempio 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);
            }
Esempio n. 3
0
 public void Init(Blending blending, int gradientMapIndex)
 {
     material = ColorfulTextMaterial.GetInstance(blending, gradientMapIndex);
 }