This commit is contained in:
2025-05-26 17:04:33 +02:00
parent f0536f4129
commit 6bda371baa
303 changed files with 1361 additions and 1372 deletions

0
Runtime/Engine/Code/Foundation/ConfigVar.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/ConfigVar.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/ConfigVarsContainer.cs Normal file → Executable file
View File

View File

16
Runtime/Engine/Code/Foundation/ConstantsAsset.cs Normal file → Executable file
View File

@@ -1,9 +1,9 @@
using UnityEngine;
namespace RebootKit.Engine.Foundation {
public class ConstantsAsset<T> : RAsset {
[SerializeField] T m_Value;
public T Value => m_Value;
}
using UnityEngine;
namespace RebootKit.Engine.Foundation {
public class ConstantsAsset<T> : RAsset {
[SerializeField] T m_Value;
public T Value => m_Value;
}
}

0
Runtime/Engine/Code/Foundation/ConstantsAsset.cs.meta Normal file → Executable file
View File

12
Runtime/Engine/Code/Foundation/ConstsColorAsset.cs Normal file → Executable file
View File

@@ -1,7 +1,7 @@
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[CreateAssetMenu(menuName = RConsts.k_CreateAssetMenu + "Constants/Consts Color")]
public class ConstsColorAsset : ConstantsAsset<Color> {
}
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[CreateAssetMenu(menuName = RConsts.k_CreateAssetMenu + "Constants/Consts Color")]
public class ConstsColorAsset : ConstantsAsset<Color> {
}
}

View File

12
Runtime/Engine/Code/Foundation/ConstsFloatAsset.cs Normal file → Executable file
View File

@@ -1,7 +1,7 @@
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[CreateAssetMenu(menuName = RConsts.k_CreateAssetMenu + "Constants/Consts Float")]
public class ConstsFloatAsset : ConstantsAsset<float> {
}
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[CreateAssetMenu(menuName = RConsts.k_CreateAssetMenu + "Constants/Consts Float")]
public class ConstsFloatAsset : ConstantsAsset<float> {
}
}

View File

12
Runtime/Engine/Code/Foundation/ConstsIntAsset.cs Normal file → Executable file
View File

@@ -1,7 +1,7 @@
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[CreateAssetMenu(menuName = RConsts.k_CreateAssetMenu + "Constants/Consts Int")]
public class ConstsIntAsset : ConfigAsset<int> {
}
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[CreateAssetMenu(menuName = RConsts.k_CreateAssetMenu + "Constants/Consts Int")]
public class ConstsIntAsset : ConfigAsset<int> {
}
}

0
Runtime/Engine/Code/Foundation/ConstsIntAsset.cs.meta Normal file → Executable file
View File

72
Runtime/Engine/Code/Foundation/ConstsProperty.cs Normal file → Executable file
View File

@@ -1,37 +1,37 @@
using System;
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[Serializable]
public struct ConstsProperty<T> {
[SerializeField] T m_InlineValue;
[SerializeField] ConstantsAsset<T> m_Asset;
[SerializeField] bool m_UseInlineValue;
public ConstsProperty(T value) {
m_InlineValue = value;
m_Asset = null;
m_UseInlineValue = true;
}
public ConstsProperty(ConstantsAsset<T> asset) {
m_InlineValue = default;
m_Asset = asset;
m_UseInlineValue = false;
}
public T Value {
get {
if (m_UseInlineValue) {
return m_InlineValue;
}
if (m_Asset != null) {
return m_Asset.Value;
}
return default;
}
}
}
using System;
using UnityEngine;
namespace RebootKit.Engine.Foundation {
[Serializable]
public struct ConstsProperty<T> {
[SerializeField] T m_InlineValue;
[SerializeField] ConstantsAsset<T> m_Asset;
[SerializeField] bool m_UseInlineValue;
public ConstsProperty(T value) {
m_InlineValue = value;
m_Asset = null;
m_UseInlineValue = true;
}
public ConstsProperty(ConstantsAsset<T> asset) {
m_InlineValue = default;
m_Asset = asset;
m_UseInlineValue = false;
}
public T Value {
get {
if (m_UseInlineValue) {
return m_InlineValue;
}
if (m_Asset != null) {
return m_Asset.Value;
}
return default;
}
}
}
}

0
Runtime/Engine/Code/Foundation/ConstsProperty.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/ControllerAsset.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/ControllerAsset.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/DIContext.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/DIContext.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/DisposableListener.cs Normal file → Executable file
View File

View File

0
Runtime/Engine/Code/Foundation/Either.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/Either.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/FloatRange.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/FloatRange.cs.meta Normal file → Executable file
View File

12
Runtime/Engine/Code/Foundation/IController.cs Normal file → Executable file
View File

@@ -96,21 +96,21 @@ namespace RebootKit.Engine.Foundation {
}
public static class ControllersManagerUtils {
public static void Add(this ControllersManager<IController> manager, ControllerAsset asset, DIContext context) {
IController controller = asset.Create(context);
public static void Add(this ControllersManager<IController> manager, ControllerAsset asset) {
IController controller = asset.Create();
manager.Add(controller);
}
public static void Add(this ControllersManager<IController> manager, List<ControllerAsset> controllerAsset, DIContext context) {
public static void Add(this ControllersManager<IController> manager, List<ControllerAsset> controllerAsset) {
foreach (ControllerAsset asset in controllerAsset) {
IController controller = asset.Create(context);
IController controller = asset.Create();
manager.Add(controller);
}
}
public static void Add(this ControllersManager<IController> manager, ControllerAsset[] controllerAsset, DIContext context) {
public static void Add(this ControllersManager<IController> manager, ControllerAsset[] controllerAsset) {
foreach (ControllerAsset asset in controllerAsset) {
IController controller = asset.Create(context);
IController controller = asset.Create();
manager.Add(controller);
}
}

0
Runtime/Engine/Code/Foundation/IController.cs.meta Normal file → Executable file
View File

8
Runtime/Engine/Code/Foundation/IFactory.cs Normal file → Executable file
View File

@@ -1,11 +1,15 @@
using UnityEngine;
namespace RebootKit.Engine.Foundation {
public interface IFactory<out TProd> {
TProd Create();
}
public interface IFactoryDI<out TProd> {
TProd Create(DIContext context);
}
public abstract class FactoryAsset<TProd> : ScriptableObject, IFactoryDI<TProd> where TProd : class {
public abstract TProd Create(DIContext context);
public abstract class FactoryAsset<TProd> : ScriptableObject, IFactory<TProd> where TProd : class {
public abstract TProd Create();
}
}

0
Runtime/Engine/Code/Foundation/IFactory.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/IPredicate.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/IPredicate.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/IService.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/IService.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/Logger.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/Logger.cs.meta Normal file → Executable file
View File

22
Runtime/Engine/Code/Foundation/SceneContext.cs Normal file → Executable file
View File

@@ -1,5 +1,4 @@
using RebootKit.Engine.Main;
using UnityEngine;
using UnityEngine;
using UnityEngine.Assertions;
namespace RebootKit.Engine.Foundation {
@@ -12,24 +11,23 @@ namespace RebootKit.Engine.Foundation {
}
[DefaultExecutionOrder(-1000)]
public class SceneContext : MonoBehaviour, IDependencyInstaller {
public class SceneContext : MonoBehaviour {
static readonly Logger s_logger = new(nameof(SceneContext));
[SerializeField] SceneDependencyInstaller[] m_Installers;
DIContext m_DIContext;
void Awake() {
DIContext context = RR.DIContext;
foreach (GameObject root in gameObject.scene.GetRootGameObjects()) {
// s_logger.Info("Injecting root game object: " + root.name);
context.InjectGameObject(root);
}
}
m_DIContext = new DIContext();
public void Install(DIContext context) {
s_logger.Info("Installing scene dependency installers");
foreach (SceneDependencyInstaller installer in m_Installers) {
installer.Install(context);
installer.Install(m_DIContext);
}
foreach (GameObject root in gameObject.scene.GetRootGameObjects()) {
m_DIContext.InjectGameObject(root);
}
}
}

0
Runtime/Engine/Code/Foundation/SceneContext.cs.meta Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/SerializableGuid.cs Normal file → Executable file
View File

View File

0
Runtime/Engine/Code/Foundation/StateMachine.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Foundation/StateMachine.cs.meta Normal file → Executable file
View File