Version: 2022.3
public Vector2 center ;

描述

矩形中心的位置。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { Rect rect = new Rect(0, 0, 100, 100); print(rect.center); rect.center = new Vector2(10, 10); } }

Did you find this page useful? Please give it a rating: