From 518fd29d75bae471431d060ceb298e51984f310f Mon Sep 17 00:00:00 2001 From: Brajanowski Date: Tue, 17 Jun 2025 23:39:51 +0200 Subject: [PATCH] something --- .../PropertyDrawers/SerializableGuidDrawer.cs | 2 +- Editor/RebootWindow/ConfigVarsView.cs | 14 +++++----- Editor/RebootWindow/GameServicesView.cs | 12 ++++----- Editor/RebootWindow/HomeView.cs | 24 +++++++++-------- Editor/RebootWindow/RebootEditorWindow.cs | 2 +- Editor/RebootWindow/TabView.cs | 18 ++++++------- Editor/RebootWindow/WorldsView.cs | 8 +++--- .../Utils/CVarSerializedPropertiesFinder.cs | 2 +- Editor/VisualElements/CVarPropertyField.cs | 14 +++++----- .../Code/Foundation/ConfigVarsContainer.cs | 6 ++--- Runtime/Engine/Code/Foundation/DIContext.cs | 6 ++--- Runtime/Engine/Code/Foundation/IController.cs | 2 +- .../Engine/Code/Foundation/SceneContext.cs | 2 +- .../Code/Foundation/SerializableGuid.cs | 2 +- ...inCameraService.cs => MainCameraSetter.cs} | 7 ++--- ...rvice.cs.meta => MainCameraSetter.cs.meta} | 0 Runtime/Engine/Code/Main/EntryPoint.cs | 2 +- Runtime/Engine/Code/Main/RR.cs | 26 ++++++++++--------- .../Code/Services/Console/ConsoleService.cs | 12 ++++----- .../Services/Console/ConsoleServiceAsset.cs | 4 +-- .../Services/ConsoleUI/ConsoleUIService.cs | 4 +-- .../Code/Services/ConsoleUI/ConsoleVC.cs | 2 +- .../Services/GameMode/GameModesService.cs | 6 ++--- .../Code/Services/Input/InputServiceAsset.cs | 2 +- .../Simulation/Interactors/IInteractor.cs | 2 +- .../Code/Services/Simulation/WorldService.cs | 18 ++++++++++--- .../Engine/Code/UI/IVisualElementBuilder.cs | 8 +++--- Runtime/Engine/Code/UI/UIDocumentView.cs | 2 +- Tests/Runtime/Engine/DIContextTests.cs | 10 +++---- 29 files changed, 118 insertions(+), 101 deletions(-) rename Runtime/Engine/Code/Graphics/{MainCameraService.cs => MainCameraSetter.cs} (52%) mode change 100755 => 100644 rename Runtime/Engine/Code/Graphics/{MainCameraService.cs.meta => MainCameraSetter.cs.meta} (100%) mode change 100755 => 100644 diff --git a/Editor/PropertyDrawers/SerializableGuidDrawer.cs b/Editor/PropertyDrawers/SerializableGuidDrawer.cs index dde1458..39580ed 100755 --- a/Editor/PropertyDrawers/SerializableGuidDrawer.cs +++ b/Editor/PropertyDrawers/SerializableGuidDrawer.cs @@ -23,7 +23,7 @@ namespace RebootKitEditor.PropertyDrawers { } public string BuildGuidString(SerializedProperty[] parts) { - StringBuilder sb = new(); + StringBuilder sb = new StringBuilder(); sb.AppendFormat("{0:X8}", parts[0].uintValue); sb.AppendFormat("{0:X8}", parts[1].uintValue); sb.AppendFormat("{0:X8}", parts[2].uintValue); diff --git a/Editor/RebootWindow/ConfigVarsView.cs b/Editor/RebootWindow/ConfigVarsView.cs index f4308c0..e68b229 100755 --- a/Editor/RebootWindow/ConfigVarsView.cs +++ b/Editor/RebootWindow/ConfigVarsView.cs @@ -10,7 +10,7 @@ namespace RebootKitEditor.RebootWindow { } public VisualElement Build() { - ScrollView scrollView = new() { + ScrollView scrollView = new ScrollView { style = { flexGrow = 1 } @@ -19,7 +19,7 @@ namespace RebootKitEditor.RebootWindow { ConfigVarsContainer.Init(); foreach (ConfigVar cvar in ConfigVarsContainer.All()) { - VisualElement varContainer = new() { + VisualElement varContainer = new VisualElement { style = { marginBottom = 8, paddingBottom = 8, @@ -28,14 +28,14 @@ namespace RebootKitEditor.RebootWindow { } }; - VisualElement valueContainer = new() { + VisualElement valueContainer = new VisualElement { style = { flexDirection = FlexDirection.Row } }; varContainer.Add(valueContainer); - Label nameLabel = new(cvar.name) { + Label nameLabel = new Label(cvar.name) { style = { color = new Color(0.7f, 0.9f, 0.9f), unityFontStyleAndWeight = FontStyle.Bold @@ -43,7 +43,7 @@ namespace RebootKitEditor.RebootWindow { }; valueContainer.Add(nameLabel); - Label valueLabel = new(cvar.ToString()) { + Label valueLabel = new Label(cvar.ToString()) { style = { color = RTheme.s_FirstColor } @@ -66,7 +66,7 @@ namespace RebootKitEditor.RebootWindow { valueContainer.Add(CreateFlagLabel("ReadOnly", new Color(0.13f, 0.07f, 0.47f))); } - Label descLabel = new(cvar.description) { + Label descLabel = new Label(cvar.description) { style = { fontSize = 10, color = new Color(0.7f, 0.7f, 0.7f) @@ -81,7 +81,7 @@ namespace RebootKitEditor.RebootWindow { } VisualElement CreateFlagLabel(string text, Color color) { - Label label = new(text) { + Label label = new Label(text) { style = { fontSize = 12, color = new Color(0.7f, 0.7f, 0.7f), diff --git a/Editor/RebootWindow/GameServicesView.cs b/Editor/RebootWindow/GameServicesView.cs index daf13b9..588660d 100755 --- a/Editor/RebootWindow/GameServicesView.cs +++ b/Editor/RebootWindow/GameServicesView.cs @@ -11,7 +11,7 @@ namespace RebootKitEditor.RebootWindow { public class GameServicesView : IView { VisualElement m_RootElement; - readonly List m_ServiceEditors = new(); + readonly List m_ServiceEditors = new List(); [Inject] EngineConfigAsset m_EngineConfigAsset; @@ -49,7 +49,7 @@ namespace RebootKitEditor.RebootWindow { } VisualElement CreateServicesView(ServiceAsset serviceAsset) where T : class, IService { - VisualElement root = new() { + VisualElement root = new VisualElement { style = { paddingBottom = 4, paddingTop = 4, @@ -60,7 +60,7 @@ namespace RebootKitEditor.RebootWindow { } }; - VisualElement header = new() { + VisualElement header = new VisualElement { style = { backgroundColor = new Color(0.2f, 0.2f, 0.2f), paddingLeft = 8, @@ -73,7 +73,7 @@ namespace RebootKitEditor.RebootWindow { }; root.Add(header); - Label nameLabel = new(serviceAsset.name) { + Label nameLabel = new Label(serviceAsset.name) { style = { color = new Color(0.7f, 0.9f, 0.9f), unityFontStyleAndWeight = FontStyle.Bold @@ -81,7 +81,7 @@ namespace RebootKitEditor.RebootWindow { }; header.Add(nameLabel); - VisualElement editorView = new() { + VisualElement editorView = new VisualElement { style = { backgroundColor = new Color(0.3f, 0.3f, 0.3f), paddingLeft = 10, @@ -96,7 +96,7 @@ namespace RebootKitEditor.RebootWindow { Editor editor = Editor.CreateEditor(serviceAsset); m_ServiceEditors.Add(editor); - InspectorElement inspectorElement = new(editor); + InspectorElement inspectorElement = new InspectorElement(editor); editorView.Add(inspectorElement); return root; diff --git a/Editor/RebootWindow/HomeView.cs b/Editor/RebootWindow/HomeView.cs index 26d3fdb..99ca093 100755 --- a/Editor/RebootWindow/HomeView.cs +++ b/Editor/RebootWindow/HomeView.cs @@ -11,14 +11,14 @@ namespace RebootKitEditor.RebootWindow { } public VisualElement Build() { - VisualElement rootContainer = new() { + VisualElement rootContainer = new VisualElement { style = { flexGrow = 1, fontSize = 14 } }; - Label label = new($"{Application.productName} {Application.version}") { + Label label = new Label($"{Application.productName} {Application.version}") { style = { fontSize = 18, unityFontStyleAndWeight = FontStyle.Bold @@ -26,7 +26,7 @@ namespace RebootKitEditor.RebootWindow { }; rootContainer.Add(label); - VisualElement persistentPathContainer = new() { + VisualElement persistentPathContainer = new VisualElement { style = { marginTop = 8, marginBottom = 8, @@ -40,7 +40,7 @@ namespace RebootKitEditor.RebootWindow { } }; - Label persistentPathLabel = new($"Persistent Path: {Application.persistentDataPath}") { + Label persistentPathLabel = new Label($"Persistent Path: {Application.persistentDataPath}") { style = { fontSize = 12, color = new Color(0.7f, 0.9f, 0.9f) @@ -48,7 +48,9 @@ namespace RebootKitEditor.RebootWindow { }; persistentPathContainer.Add(persistentPathLabel); - Button openPersistentPathButton = new(() => { Application.OpenURL(Application.persistentDataPath); }) { + Button openPersistentPathButton = new Button(() => { + Application.OpenURL(Application.persistentDataPath); + }) { style = { fontSize = 12, width = 48 @@ -59,7 +61,7 @@ namespace RebootKitEditor.RebootWindow { rootContainer.Add(persistentPathContainer); - Label onGameRunScriptLabel = new("On Game Run Script (User):") { + Label onGameRunScriptLabel = new Label("On Game Run Script (User):") { style = { fontSize = 12, color = new Color(0.7f, 0.9f, 0.9f) @@ -67,7 +69,7 @@ namespace RebootKitEditor.RebootWindow { }; rootContainer.Add(onGameRunScriptLabel); - TextField onGameRunScriptTextField = new() { + TextField onGameRunScriptTextField = new TextField { style = { fontSize = 12, }, @@ -80,7 +82,7 @@ namespace RebootKitEditor.RebootWindow { }); rootContainer.Add(onGameRunScriptTextField); - Label consoleCommandsLabel = new("Console Commands:") { + Label consoleCommandsLabel = new Label("Console Commands:") { style = { fontSize = 12, color = new Color(0.7f, 0.9f, 0.9f) @@ -90,7 +92,7 @@ namespace RebootKitEditor.RebootWindow { ConsoleService.ConsoleCommand[] consoleCommands = ConsoleService.GenerateCommandsToRegister(); foreach (ConsoleService.ConsoleCommand consoleCommand in consoleCommands) { - VisualElement commandContainer = new() { + VisualElement commandContainer = new VisualElement { style = { flexDirection = FlexDirection.Row, marginTop = 4, @@ -101,7 +103,7 @@ namespace RebootKitEditor.RebootWindow { paddingBottom = 4, } }; - Label commandLabel = new(consoleCommand.name) { + Label commandLabel = new Label(consoleCommand.name) { style = { fontSize = 12, color = new Color(0.7f, 0.9f, 0.9f) @@ -109,7 +111,7 @@ namespace RebootKitEditor.RebootWindow { }; commandContainer.Add(commandLabel); - Label descriptionLabel = new(consoleCommand.description) { + Label descriptionLabel = new Label(consoleCommand.description) { style = { fontSize = 12, color = new Color(0.5f, 0.7f, 0.7f) diff --git a/Editor/RebootWindow/RebootEditorWindow.cs b/Editor/RebootWindow/RebootEditorWindow.cs index 14cb6dc..fd2d961 100755 --- a/Editor/RebootWindow/RebootEditorWindow.cs +++ b/Editor/RebootWindow/RebootEditorWindow.cs @@ -24,7 +24,7 @@ namespace RebootKitEditor.RebootWindow { } public class RebootEditorWindow : EditorWindow { - static readonly Logger s_logger = new(nameof(RebootEditorWindow)); + static readonly Logger s_logger = new Logger(nameof(RebootEditorWindow)); EngineConfigAsset m_EngineConfigAsset; DIContext m_DIContext; diff --git a/Editor/RebootWindow/TabView.cs b/Editor/RebootWindow/TabView.cs index cd97671..c19b48e 100755 --- a/Editor/RebootWindow/TabView.cs +++ b/Editor/RebootWindow/TabView.cs @@ -12,16 +12,16 @@ namespace RebootKitEditor.RebootWindow { public VisualElement container; } - readonly List m_Tabs = new(); - readonly List m_TabContents = new(); - readonly List