using UnityEngine;
using System.Collections;
public class BlitTest : MonoBehaviour {
// Use this for initialization
void Start ()
{
Texture2D texture
= new Texture2D
( 500,
500, TextureFormat
.ARGB32,
false ); for( int x = 0; x < 500; x++ )
{
for( int y = 0; y < 500; y++ )
{
texture
.SetPixel( x, y,
new Color
( Random
.Range( 0f, 1f
), Random
.Range( 0f, 1f
), Random
.Range( 0f, 1f
) ) ); }
}
texture.Apply();
GameObject.FindObjectOfType<UITexture>().mainTexture = texture;
}
}