Texture.width 宽度
var width : int
Description描述
Width of the texture in pixels (Read Only)
基于像素的贴图宽度(只读)
C#
JavaScript
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);}