Version: 2022.3
언어: 한국어
public static bool LinkButton (Rect position, string label);
public static bool LinkButton (Rect position, GUIContent label);

파라미터

position Rectangle on the screen to use for the control. The underline is done with the bottom border so set the size accordingly.
label Label of the link.

반환

bool true when the user clicks the link.

설명

Make a clickable link label.

The label has an hyperlink style and returns true when clicked.

using UnityEditor;
using UnityEngine;

class EditorGUILinkButton : EditorWindow { [MenuItem("Examples/EditorGUILinkButton")] static void Init() { var window = GetWindow<EditorGUILinkButton>(); window.Show(); }

void OnGUI() { var label = new GUIContent("Link Button"); var size = EditorStyles.linkLabel.CalcSize(label); if (EditorGUI.LinkButton(new Rect(50, 50, size.x, size.y), label)) Debug.Log("Clicked"); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961