TextureFormat.Alpha8

TextureFormat.Alpha8

Description描述

Alpha-only texture format.

仅Alpha纹理格式。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Start() {
		Texture2D texture = new Texture2D(128, 128, TextureFormat.Alpha8, false);
		renderer.material.mainTexture = texture;
	}
}
function Start () {
	// Create a new alpha-only texture and assign it
	// to the renderer's material
	//创建一个新的仅alpha纹理格式,并指定个渲染器材质
	var texture = new Texture2D (128, 128, TextureFormat.Alpha8, false);
	renderer.material.mainTexture = texture;
}

参见:Texture2D.Texture2D, texture assets

最后修改:2011年9月18日 Sunday 15:09

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。