|
@@ -0,0 +1,46 @@
|
|
|
|
|
+using ChivaXR;
|
|
|
|
|
+using ChivaXR.Op;
|
|
|
|
|
+using Sirenix.OdinInspector;
|
|
|
|
|
+using System.Collections;
|
|
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
+using System.Linq;
|
|
|
|
|
+using UnityEngine;
|
|
|
|
|
+
|
|
|
|
|
+public class RemoveRedundantOp : MonoBehaviour
|
|
|
|
|
+{
|
|
|
|
|
+ // Start is called before the first frame update
|
|
|
|
|
+ void Start()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Update is called once per frame
|
|
|
|
|
+ void Update()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [Button("去除多余OP")]
|
|
|
|
|
+ public void RemoveRedundantOpOnScene()
|
|
|
|
|
+ {
|
|
|
|
|
+ List<string> dataInfos = new List<string>();
|
|
|
|
|
+
|
|
|
|
|
+ foreach (ProcessElement item in ProcessManagement.Instance.processes)
|
|
|
|
|
+ {
|
|
|
|
|
+ dataInfos.Add(((PB_OpData)item.processBase).opData.operationDataName);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = OperationManager.Instance.operationDataContainers.Count-1; i >0 ; i--)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!dataInfos.Contains(OperationManager.Instance.operationDataContainers[i].OpDataName))
|
|
|
|
|
+ {
|
|
|
|
|
+ GameObject obj = OperationManager.Instance.operationDataContainers[i].opData.gameObject;
|
|
|
|
|
+ OperationManager.Instance.operationDataContainers.RemoveAt(i);
|
|
|
|
|
+ DestroyImmediate(obj);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+}
|