【m】框架大更新
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using Stary.Evo;
|
||||
using Stary.Evo.Editor;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.Editor
|
||||
{
|
||||
[CustomEditor(typeof(ArtSceneData))]
|
||||
public class ArtSceneDataEditor : OdinEditor
|
||||
{
|
||||
// /// <summary>
|
||||
// /// 序列化属性,在OnEnable中获取
|
||||
// /// </summary>
|
||||
// [HideInInspector] private SerializedProperty artScenes;
|
||||
private void OnEnable()
|
||||
{
|
||||
//artScenes = serializedObject.FindProperty("artScenes");
|
||||
ArtSceneData artSceneData = (ArtSceneData)target;
|
||||
List<ArtScene> artScenesList = artSceneData.artScenes;
|
||||
List<int> removeIndexList = new List<int>();
|
||||
for (int i = 0; i < artScenesList.Count; i++)
|
||||
{
|
||||
ArtScene artScene = artScenesList[i];
|
||||
if (artScene.sceneAsset==null)
|
||||
{
|
||||
removeIndexList.Add(i);
|
||||
}
|
||||
}
|
||||
for (int i = removeIndexList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
int index = removeIndexList[i];
|
||||
artScenesList.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user