Skip to content

Commit

Permalink
切换选择时输出日志,类型超链接
Browse files Browse the repository at this point in the history
  • Loading branch information
KumoKyaku committed Dec 30, 2023
1 parent ea75578 commit 896e2a5
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,26 @@ protected void DrawReference(SerializedProperty property, GUIContent label, Rect
var indexCacheKey = (property.serializedObject.targetObject, property.propertyPath);
SelectedIndex.TryGetValue(indexCacheKey, out var index);

var oldSelectedIndex = index;
index = EditorGUI.Popup(popPosition, index, SupportNames);

SelectedIndex[indexCacheKey] = index;

var targetType = SupportTypes[index];

if (oldSelectedIndex != index)
{
//这里打印日志,方便定为脚本文件位置。
if (targetType == null)
{
Debug.Log($"Select Type: null");
}
else
{
Debug.Log($"Select Type: {targetType.GetUnityProjectLink()}");
}
}

//new button 放在上面,不然new时会与Expanded折叠功能冲突。
if (GUI.Button(leftPosotion, "New", left))
{
Expand Down

0 comments on commit 896e2a5

Please sign in to comment.