Exemplo n.º 1
0
 public static void FillTexture(Texture2D t, Color c)
 {
     Color[] colors = new Color[t.width * t.height];
     JUtilities.Fill(colors, c);
     t.SetPixels(colors);
     t.Apply();
 }
Exemplo 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];
            JUtilities.Fill(colors, fill);
            t.SetPixels(colors);
            t.Apply();
            return(t);
        }
Exemplo n.º 3
0
 public static void ResetArray <T>(ref T[] array, int count, T defaultValue)
 {
     if (array != null && array.Length == count)
     {
         JUtilities.Fill(array, defaultValue);
     }
     else
     {
         array = new T[count];
     }
 }