using System.Collections; using System.Collections.Generic; using Unity.VisualScripting; using UnityEditor; using UnityEngine; namespace Ether { public class SceneSaveManagerEditor { public static ES3ReferenceMgr RefMgr { get { return (ES3ReferenceMgr)ES3ReferenceMgr.Current; } } [MenuItem("GameObject/场景/场景保存管理器", priority = 0)] public static void CreateSceneSaveManager() { GameObject mgr = null; if (RefMgr != null) mgr = RefMgr.gameObject; if (mgr == null) mgr = new GameObject("SceneSaveManager"); if (mgr.GetComponent() == null) { var refMgr = mgr.AddComponent(); if (!Application.isPlaying && ES3Settings.defaultSettingsScriptableObject.autoUpdateReferences) refMgr.RefreshDependencies(); } if (mgr.GetComponent() == null) { ES3AutoSaveMgr autoSaveMgr = mgr.AddComponent(); } if (mgr.GetComponent() == null) { mgr.AddComponent(); } Undo.RegisterCreatedObjectUndo(mgr, "Enabled Easy Save for Scene"); Selection.activeObject = mgr; } } }