首页 > 其他分享 >用Handles在场景中显示文本

用Handles在场景中显示文本

时间:2023-01-30 14:59:31浏览次数:34  
标签:style 场景 spot Handles GizmoType 文本

场景中挂在了Spot的物体前会显示文本

public class SceneShow : Editor

{

[DrawGizmo(GizmoType.InSelectionHierarchy | GizmoType.NotInSelectionHierarchy)]
static void ShowHexSpot(Spot spot, GizmoType gizmoType)
{
GUIStyle style = new GUIStyle();
style.normal.textColor = Color.green;
string temp = string.Format("id: {0}\nq_r: {1}", spot.spot.hexSpotInfo.id, spot.spot.hexSpotInfo.hex.getAxialPosString());
Handles.Label(spot.transform.position + Vector3.up * 0.2F, temp, style);
}

}

标签:style,场景,spot,Handles,GizmoType,文本
From: https://www.cnblogs.com/mcyushao/p/17075896.html

相关文章