Пример #1
0
        public static bool NewTextureOptions_PEGI(this PlaytimePainter p)
        {
            bool changes = false;

            if (p.ImgData != null)
            {
                return(changes);
            }

            if (p.MaterialTexturePropertyName == null)
            {
                pegi.write("This material has no textures");
                pegi.newLine();
                return(changes);
            }

            bool color = pegi.Click(icon.NewTexture.getIcon(), "New Texture", 25);

            if (pegi.Click("Create Mask") || color)
            {
                List <string> texes = p.GetMaterialTextureNames();
                if (texes.Count > 0)
                {
                    p.CreateTexture2D(256, "New " + p.MaterialTexturePropertyName, color);
                    changes = true;
                }
            }

            return(changes);
        }
Пример #2
0
        public static bool SelectTexture_PEGI(this PlaytimePainter p)
        {
            int ind = p.SelectedTexture;

            if (pegi.select(ref ind, p.GetMaterialTextureNames()))
            {
                p.SetOriginalShaderOnThis();
                p.SelectedTexture = ind;
                p.OnChangedTexture_OnMaterial();
                p.CheckPreviewShader();
                return(true);
            }
            return(false);
        }