update UIElements

This commit is contained in:
何冠峰
2025-03-06 11:45:51 +08:00
parent 317c42521a
commit b71eeeb855
42 changed files with 25 additions and 25 deletions
@@ -0,0 +1,33 @@
#if UNITY_2019_4_OR_NEWER
using UnityEditor;
namespace YooAsset.Editor
{
public class AssetPathCell : StringValueCell
{
public AssetPathCell(string searchTag, object cellValue) : base(searchTag, 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
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ed1c077653e577846ba29aadb91f13ec
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,40 @@
#if UNITY_2019_4_OR_NEWER
using System;
namespace YooAsset.Editor
{
public class BooleanValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string SearchTag { private set; get; }
public bool BooleanValue
{
get
{
return (bool)CellValue;
}
}
public BooleanValueCell(string searchTag, object cellValue)
{
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()
{
return CellValue.ToString();
}
public int CompareTo(object other)
{
if (other is BooleanValueCell cell)
{
return this.BooleanValue.CompareTo(cell.BooleanValue);
}
else
{
return 0;
}
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f7b1e743b81646b49b2c05721edcf9b4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,25 @@
#if UNITY_2019_4_OR_NEWER
using System;
namespace YooAsset.Editor
{
public class ButtonCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string SearchTag { private set; get; }
public ButtonCell(string searchTag)
{
SearchTag = searchTag;
}
public object GetDisplayObject()
{
return string.Empty;
}
public int CompareTo(object other)
{
return 1;
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fe6c2551d70d6934da0b6afce3f1062c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,40 @@
#if UNITY_2019_4_OR_NEWER
using System;
namespace YooAsset.Editor
{
public class IntegerValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string SearchTag { private set; get; }
public long IntegerValue
{
get
{
return (long)CellValue;
}
}
public IntegerValueCell(string searchTag, object cellValue)
{
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()
{
return CellValue.ToString();
}
public int CompareTo(object other)
{
if (other is IntegerValueCell cell)
{
return this.IntegerValue.CompareTo(cell.IntegerValue);
}
else
{
return 0;
}
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: be8ecb3981efa744f89ee5d3c9e7b7ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,40 @@
#if UNITY_2019_4_OR_NEWER
using System;
namespace YooAsset.Editor
{
public class SingleValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string SearchTag { private set; get; }
public double SingleValue
{
get
{
return (double)CellValue;
}
}
public SingleValueCell(string searchTag, object cellValue)
{
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()
{
return CellValue.ToString();
}
public int CompareTo(object other)
{
if (other is SingleValueCell cell)
{
return this.SingleValue.CompareTo(cell.SingleValue);
}
else
{
return 0;
}
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ae299b7a930e03f458977750de9ca18e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,40 @@
#if UNITY_2019_4_OR_NEWER
using System;
namespace YooAsset.Editor
{
public class StringValueCell : ITableCell, IComparable
{
public object CellValue { set; get; }
public string SearchTag { private set; get; }
public string StringValue
{
get
{
return (string)CellValue;
}
}
public StringValueCell(string searchTag, object cellValue)
{
SearchTag = searchTag;
CellValue = cellValue;
}
public object GetDisplayObject()
{
return CellValue;
}
public int CompareTo(object other)
{
if (other is StringValueCell cell)
{
return this.StringValue.CompareTo(cell.StringValue);
}
else
{
return 0;
}
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a04fd2585c5538547b9755673aea76df
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: