Legacy Documentation: Version 2018.2 (Go to current version)
LanguageEnglish
  • C#

Texture.width

public int width;

Description

Width of the texture in pixels. (Read Only)

using UnityEngine;

public class Example : MonoBehaviour { // Print texture size to the Console Texture texture; void Start() { print("Size is " + texture.width + " by " + texture.height); } }
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答