Version: 2022.3

描述

指定哪些轴应显示控制手柄的标志。

默认启用所有轴。您可以使用按位运算来启用或禁用各个轴。已禁用的轴将被展平。

using UnityEngine;
using UnityEditor;
using UnityEditor.IMGUI.Controls;

public class ExampleScript : MonoBehaviour { void Start() { // create a 2D box handle that only works on the x- and y-axes BoxBoundsHandle box = new BoxBoundsHandle("MyBox".GetHashCode()); box.axes = PrimitiveBoundsHandle.Axes.X | PrimitiveBoundsHandle.Axes.Y; } }