update UIElements
This commit is contained in:
@@ -1,12 +1,33 @@
|
||||
#if UNITY_2019_4_OR_NEWER
|
||||
using UnityEditor;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
public class AssetPathCell : StringValueCell
|
||||
{
|
||||
public AssetPathCell(string headerTitle) : base(headerTitle)
|
||||
public AssetPathCell(string headerTitle, object cellValue) : base(headerTitle, cellValue)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检视资源对象
|
||||
/// Ping an asset object in the Scene like clicking it in an inspector.
|
||||
/// </summary>
|
||||
public bool PingAssetObject()
|
||||
{
|
||||
var assetPath = StringValue;
|
||||
var assetGUID = AssetDatabase.AssetPathToGUID(assetPath);
|
||||
if (string.IsNullOrEmpty(assetGUID))
|
||||
return false;
|
||||
|
||||
UnityEngine.Object asset = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(assetPath);
|
||||
if (asset == null)
|
||||
return false;
|
||||
|
||||
Selection.activeObject = asset;
|
||||
EditorGUIUtility.PingObject(asset);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -15,9 +15,10 @@ namespace YooAsset.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public IntegerValueCell(string headerTitle)
|
||||
public IntegerValueCell(string headerTitle, object cellValue)
|
||||
{
|
||||
HeaderTitle = headerTitle;
|
||||
CellValue = cellValue;
|
||||
}
|
||||
public object GetDisplayObject()
|
||||
{
|
||||
|
||||
@@ -15,9 +15,10 @@ namespace YooAsset.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public SingleValueCell(string headerTitle)
|
||||
public SingleValueCell(string headerTitle, object cellValue)
|
||||
{
|
||||
HeaderTitle = headerTitle;
|
||||
CellValue = cellValue;
|
||||
}
|
||||
public object GetDisplayObject()
|
||||
{
|
||||
|
||||
@@ -15,9 +15,10 @@ namespace YooAsset.Editor
|
||||
}
|
||||
}
|
||||
|
||||
public StringValueCell(string headerTitle)
|
||||
public StringValueCell(string headerTitle, object cellValue)
|
||||
{
|
||||
HeaderTitle = headerTitle;
|
||||
CellValue = cellValue;
|
||||
}
|
||||
public object GetDisplayObject()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user