DI updates

This commit is contained in:
2025-03-17 18:43:45 +01:00
parent 569b1d00b3
commit f80fd22a00
18 changed files with 42 additions and 53 deletions

View File

@@ -58,9 +58,7 @@ namespace RebootKit.Engine.Foundation {
Type type = typeof(T);
foreach (FieldInfo field in type.GetFields(k_fieldsBindingFlags)) {
if (!InjectField(field, target)) {
return;
}
InjectField(field, target);
}
foreach (MethodInfo method in type.GetMethods(k_methodsBindingFlags)) {

View File

@@ -1,15 +1,11 @@
using System;
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine;
namespace RebootKit.Engine.Foundation {
public interface IService : IDisposable {
UniTask OnInit(CancellationToken cancellationToken);
}
public abstract class ServiceMonoBehaviour : MonoBehaviour, IService {
public abstract UniTask OnInit(CancellationToken cancellationToken);
public abstract void Dispose();
}