Esempio n. 1
0
 public static void FillTexture(Texture2D t, Color c)
 {
     Color[] colors = new Color[t.width * t.height];
     PUtilities.Fill(colors, c);
     t.SetPixels(colors);
     t.Apply();
 }
Esempio n. 2
0
        public static Texture2D CreateTexture(int resolution, Color fill, TextureFormat format = TextureFormat.ARGB32)
        {
            Texture2D t = new Texture2D(resolution, resolution, format, false);

            Color[] colors = new Color[resolution * resolution];
            PUtilities.Fill(colors, fill);
            t.SetPixels(colors);
            t.Apply();
            return(t);
        }
Esempio n. 3
0
 public static void ResetArray <T>(ref T[] array, int count, T defaultValue)
 {
     if (array != null && array.Length == count)
     {
         PUtilities.Fill(array, defaultValue);
     }
     else
     {
         array = new T[count];
     }
 }