Ejemplo 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();
 }
Ejemplo 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);
        }
Ejemplo 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];
     }
 }