Texture.width 宽度

var width : int

Description描述

Width of the texture in pixels (Read Only)

基于像素的贴图宽度(只读)

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Texture texture;
	void Start() {
		print("Size is " + texture.width + " by " + texture.height);
	}
}
// Print texture size to the Console
//输出贴图大小到控制台
var texture : Texture;
function Start () {
	print("Size is " + texture.width + " by " + texture.height);
}
最后修改:2010年12月14日 Tuesday 17:53

本脚本参考基于Unity 3.4.1f5

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