Version: 2017.3

Handles.DrawSolidDisc

切换到手册
public static void DrawSolidDisc (Vector3 center, Vector3 normal, float radius);

参数

center 圆盘的中心。
normal 圆盘的法线。
radius 圆盘的半径。

注意:如果您希望拥有恒定屏幕大小的手柄,请使用 HandleUtility.GetHandleSize。

描述

在 3D 空间中绘制一个实心平面圆盘。

\ 场景视图中的实心圆盘。

// Create a semi transparent white disc with a ScaleValueHandle attached to the disc
// that lets you modify the "areaOfEffect" var in the WireDiscExample.js

@CustomEditor (SolidDiscExample) class DrawSolidDisc extends Editor { function OnSceneGUI () { Handles.color = Color(1,0,0,0.1); Handles.DrawSolidDisc(target.transform.position, Vector3.up, target.areaOfEffect); Handles.color = Color.red; target.areaOfEffect = Handles.ScaleValueHandle(target.areaOfEffect, target.transform.position + Vector3(target.areaOfEffect,0,0), Quaternion.identity, 2, Handles.CylinderCap, 2); } }

附加到此手柄的脚本:

//SolidDiscExample.js

var areaOfEffect : float = 5;