Exemplo n.º 1
0
 public static CCGradient GetDefaultGradient()
 {
     CCGradientColorKey[] colorKeys = new CCGradientColorKey[] {
         new CCGradientColorKey(Color.white, 0f), new CCGradientColorKey(Color.white, 1f)
     };
     CCGradientAlphaKey[] alphaKeys = new CCGradientAlphaKey[] {
         new CCGradientAlphaKey(1f, 0f), new CCGradientAlphaKey(1f, 1f)
     };
     return(new CCGradient(colorKeys, alphaKeys));
 }
Exemplo n.º 2
0
        protected void CreateDefaultGradient()
        {
            CCGradientColorKey[] colorKeys = new CCGradientColorKey[] {
                new CCGradientColorKey(Color.white, 0f), new CCGradientColorKey(Color.white, 1f)
            };
            CCGradientAlphaKey[] alphaKeys = new CCGradientAlphaKey[] {
                new CCGradientAlphaKey(1f, 0f), new CCGradientAlphaKey(1f, 1f)
            };

    #if UNITY_EDITOR
            if (UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode)
            {
                AddGradient(new CCGradient(colorKeys, alphaKeys));
            }
            else
            {
                CreateAtlasTexture(0, gradientWidth, gradientHeight);
                AddGradient(new CCGradient(colorKeys, alphaKeys));
            }
    #else
            AddGradient(new CCGradient(colorKeys, alphaKeys));
    #endif
        }