refactor
This commit is contained in:
@@ -1,22 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
using RebootKit.Engine;
|
||||
using RebootKit.Engine.Foundation;
|
||||
using RebootKit.Engine.UI;
|
||||
using UnityEditor;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace RebootKitEditor.RebootWindow {
|
||||
namespace RebootKit.Editor.RebootWindow {
|
||||
public class GameServicesView : IView {
|
||||
VisualElement m_RootElement;
|
||||
|
||||
readonly List<Editor> m_ServiceEditors = new List<Editor>();
|
||||
readonly List<UnityEditor.Editor> m_ServiceEditors = new List<UnityEditor.Editor>();
|
||||
|
||||
[Inject] EngineConfigAsset m_EngineConfigAsset;
|
||||
|
||||
public void Dispose() {
|
||||
foreach (Editor editor in m_ServiceEditors) {
|
||||
foreach (UnityEditor.Editor editor in m_ServiceEditors) {
|
||||
if (editor != null) {
|
||||
Object.DestroyImmediate(editor);
|
||||
}
|
||||
@@ -93,7 +89,7 @@ namespace RebootKitEditor.RebootWindow {
|
||||
};
|
||||
root.Add(editorView);
|
||||
|
||||
Editor editor = Editor.CreateEditor(serviceAsset);
|
||||
UnityEditor.Editor editor = UnityEditor.Editor.CreateEditor(serviceAsset);
|
||||
m_ServiceEditors.Add(editor);
|
||||
|
||||
InspectorElement inspectorElement = new InspectorElement(editor);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using RebootKit.Engine;
|
||||
using RebootKit.Editor.RebootWindow;
|
||||
using RebootKit.Engine;
|
||||
using RebootKit.Engine.Foundation;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using Logger = RebootKit.Engine.Foundation.Logger;
|
||||
using TabView = RebootKit.Editor.RebootWindow.TabView;
|
||||
|
||||
namespace RebootKitEditor.RebootWindow {
|
||||
static class RTheme {
|
||||
@@ -27,7 +29,6 @@ namespace RebootKitEditor.RebootWindow {
|
||||
static readonly Logger s_logger = new Logger(nameof(RebootEditorWindow));
|
||||
|
||||
EngineConfigAsset m_EngineConfigAsset;
|
||||
DIContext m_DIContext;
|
||||
|
||||
VisualElement m_RootElement;
|
||||
TabView m_TabView;
|
||||
@@ -55,15 +56,11 @@ namespace RebootKitEditor.RebootWindow {
|
||||
}
|
||||
}
|
||||
|
||||
m_DIContext = new DIContext();
|
||||
m_DIContext.Bind(this);
|
||||
m_DIContext.Bind(m_EngineConfigAsset);
|
||||
|
||||
m_TabView = m_DIContext.Create<TabView>();
|
||||
m_TabView.AddTab("Home", m_DIContext.Create<HomeView>());
|
||||
m_TabView.AddTab("Config Vars", m_DIContext.Create<ConfigVarsView>());
|
||||
m_TabView.AddTab("Game Services", m_DIContext.Create<GameServicesView>());
|
||||
m_TabView.AddTab("Worlds", m_DIContext.Create<WorldsView>());
|
||||
m_TabView = new TabView();
|
||||
m_TabView.AddTab("Home", new HomeView());
|
||||
m_TabView.AddTab("Config Vars", new ConfigVarsView());
|
||||
m_TabView.AddTab("Game Services", new GameServicesView());
|
||||
m_TabView.AddTab("Worlds", new WorldsView());
|
||||
}
|
||||
|
||||
void CreateGUI() {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using RebootKit.Engine.UI;
|
||||
using RebootKitEditor.RebootWindow;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Assertions;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace RebootKitEditor.RebootWindow {
|
||||
namespace RebootKit.Editor.RebootWindow {
|
||||
public class TabView : IView {
|
||||
struct Tab {
|
||||
public string name;
|
||||
|
||||
Reference in New Issue
Block a user