void Start () {
//load the prepared image data
TextAsset colortxt;
TextAsset alphatxt;
Texture2D colorjpg
= new Texture2D
(4,
4); Texture2D alphapng
= new Texture2D
(4,
4);
colortxt = Resources.Load("1024cloak01") as TextAsset;
alphatxt = Resources.Load ("1024cloak01A") as TextAsset;
colorjpg.LoadImage(colortxt.bytes);
alphapng.LoadImage(alphatxt.bytes);
//load the prepared Shader asset
Shader rgbplusa;
rgbplusa = Shader.Find("RGBplusA");
//use NGUI to display the image pixel-perfect, make use of the camera setup created with NGUI > Open the UI Wizard
UITexture perfect = NGUITools.AddWidget<UITexture>(GameObject.Find ("Panel"));
perfect
.material = new Material
(rgbplusa
); perfect.material.SetTexture("_MainTex", colorjpg);
perfect.material.SetTexture("_Mask", alphapng);
perfect.MakePixelPerfect();
}