1
This commit is contained in:
37
Src/UnityEditor/AssetCacheScriptableObject.cs
Normal file
37
Src/UnityEditor/AssetCacheScriptableObject.cs
Normal 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
|
||||
}
|
11
Src/UnityEditor/AssetCacheScriptableObject.cs.meta
Normal file
11
Src/UnityEditor/AssetCacheScriptableObject.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 80b507ad25f1af24687db7fa18d953fd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
16
Src/UnityEditor/BITKit.Unity.Editor.asmdef
Normal file
16
Src/UnityEditor/BITKit.Unity.Editor.asmdef
Normal 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
|
||||
}
|
7
Src/UnityEditor/BITKit.Unity.Editor.asmdef.meta
Normal file
7
Src/UnityEditor/BITKit.Unity.Editor.asmdef.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3bfa6f714e036734185ec6f5b157610a
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user