コード例 #1
0
ファイル: PCommon.cs プロジェクト: ComradeCrunchy/Ranch
 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();
 }
コード例 #2
0
ファイル: PCommon.cs プロジェクト: ComradeCrunchy/Ranch
        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);
        }
コード例 #3
0
ファイル: PUtilities.cs プロジェクト: ComradeCrunchy/Ranch
 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];
     }
 }