This commit is contained in:
CortexCore
2023-10-24 23:37:59 +08:00
parent 325f63d6bc
commit 3e39e627bc
388 changed files with 29043 additions and 889 deletions

View File

@@ -0,0 +1,37 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
namespace BITKit
{
public class AssetCacheScriptableObject : ScriptableObject
{
[SerializeField] private bool isEditable;
[SerializeField] private Object[] _assets;
public bool IsEditable => isEditable;
public Object[] Assets => _assets;
}
#if UNITY_EDITOR
[CustomEditor(typeof(AssetCacheScriptableObject))]
public class AssetCacheScriptableObjectEditor : BITInspector<AssetCacheScriptableObject>
{
public override VisualElement CreateInspectorGUI()
{
if (agent.IsEditable)
{
return base.CreateInspectorGUI();
}
foreach (var x in agent.Assets)
{
var field = root.Create<PropertyField>();
field.Bind(new SerializedObject(x));
}
return root;
}
}
#endif
}

View File

@@ -0,0 +1,16 @@
{
"name": "BITKit.Unity.Editor",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}