【m】修改框架編輯器
This commit is contained in:
41
Assets/00.StaryEvo/Runtime/PlayerSettings/ArtSceneData.cs
Normal file
41
Assets/00.StaryEvo/Runtime/PlayerSettings/ArtSceneData.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.Editor
|
||||
{
|
||||
[CreateAssetMenu(fileName = "ArtSceneData", menuName = "Evo/ArtSceneData")]
|
||||
public class ArtSceneData : ScriptableObject
|
||||
{
|
||||
[ListDrawerSettings(DraggableItems = false, ShowFoldout = false, ShowPaging = false, ShowItemCount = false)]
|
||||
public List<ArtScene> artScenes = new List<ArtScene>();
|
||||
|
||||
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class ArtScene
|
||||
{
|
||||
[LabelText("场景名称")]
|
||||
public string sceneName;
|
||||
#if UNITY_EDITOR
|
||||
[LabelText("场景实例")][OnValueChanged("LoadScenePath")]
|
||||
public SceneAsset sceneAsset;
|
||||
#endif
|
||||
[LabelText("场景路径")][ReadOnly]
|
||||
public string scenePath;
|
||||
[LabelText("场景标识符")][ReadOnly]
|
||||
public string sceneIdentifier;
|
||||
public void LoadScenePath()
|
||||
{
|
||||
if (sceneAsset == null)
|
||||
{
|
||||
Debug.LogError($"ArtScene {sceneName} 资源不存在,请检查!");
|
||||
return;
|
||||
}
|
||||
scenePath = AssetDatabase.GetAssetPath(sceneAsset);
|
||||
sceneIdentifier= $"Scenes_{sceneAsset.name}" ;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user