【m】框架大更新
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#if UNITY_2019_4_OR_NEWER
|
||||
using UnityEditor;
|
||||
using System;
|
||||
|
||||
namespace YooAsset.Editor
|
||||
{
|
||||
public class AssetObjectCell : ITableCell, IComparable
|
||||
{
|
||||
public string SearchTag { private set; get; }
|
||||
public object CellValue { set; get; }
|
||||
public string StringValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)CellValue;
|
||||
}
|
||||
}
|
||||
|
||||
public AssetObjectCell(string searchTag, string assetPath)
|
||||
{
|
||||
SearchTag = searchTag;
|
||||
CellValue = assetPath;
|
||||
}
|
||||
|
||||
public object GetDisplayObject()
|
||||
{
|
||||
return AssetDatabase.LoadMainAssetAtPath(StringValue);
|
||||
}
|
||||
public int CompareTo(object other)
|
||||
{
|
||||
if (other is AssetObjectCell cell)
|
||||
{
|
||||
return this.StringValue.CompareTo(cell.StringValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb9cd0317d5d37744a64f7dc387f2b00
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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: 178d63a8e7b71214baf560c62c9197cb
|
||||
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: fb95b62c7e537284198c8f616a56a2b5
|
||||
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: 04b6a970c6223d94dac57fea2233ddd1
|
||||
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: ede51db796e772d41a2cf6a621c29e58
|
||||
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: d2cdc9b75eb366a45ae08d582d993887
|
||||
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: 48544f95d38361e43af1f1d9fd97ef23
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user