기술 자료

Unity Engine

Unity Engine

width

The width of the rectangle, measured from the X position.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public float width { readonly get; set; }

Remarks

Setting this value will also change Rect.xMax.

Examples

using UnityEngine;public class RectExample : MonoBehaviour{ // Use this for initialization void Start() { Rect rect = new Rect(10, 10, 50, 30); Debug.Log("width = " + rect.width); // prints: width = 50 rect.width = 20; Debug.Log("new max x = " + rect.xMax); // prints: new max x = 30 }}