1
This commit is contained in:
@@ -287,7 +287,9 @@ namespace BITKit
|
||||
BIT4Log.Warning<BITApp>($"{nameof(BITApp)}初始化错误:");
|
||||
BIT4Log.LogException(e);
|
||||
}
|
||||
|
||||
#if NET5_0_OR_GREATER
|
||||
ServiceProvider = ServiceCollection.BuildServiceProvider();
|
||||
#endif
|
||||
}
|
||||
public static void Stop()
|
||||
{
|
||||
|
@@ -17,6 +17,9 @@ namespace BITKit.Entities
|
||||
IEntityComponent[] Components { get; }
|
||||
bool RegisterComponent<T>(T component);
|
||||
IServiceProvider ServiceProvider { get; }
|
||||
#if NET5_0_OR_GREATER
|
||||
IServiceCollection ServiceCollection { get; }
|
||||
#endif
|
||||
void Inject(object obj);
|
||||
}
|
||||
/// <summary>
|
||||
|
@@ -65,9 +65,9 @@ namespace BITKit
|
||||
public bool TryGetEntried(out T value)
|
||||
{
|
||||
EnsureConfiguration();
|
||||
if (index is not -1)
|
||||
if (m_index is not -1)
|
||||
{
|
||||
value = list[index];
|
||||
value = list[m_index];
|
||||
return true;
|
||||
}
|
||||
value = default;
|
||||
@@ -86,7 +86,6 @@ namespace BITKit
|
||||
else
|
||||
{
|
||||
var currentIndex = m_index;
|
||||
m_index = index;
|
||||
if (currentIndex is not -1 && list.TryGetElementAt(currentIndex, out var currentElement))
|
||||
{
|
||||
currentElement.Exit();
|
||||
@@ -100,7 +99,7 @@ namespace BITKit
|
||||
currentElement.IsEntered = false;
|
||||
OnExit?.Invoke(currentElement);
|
||||
}
|
||||
|
||||
m_index = index;
|
||||
if (index is not -1 && list.TryGetElementAt(index, out var nextElement))
|
||||
{
|
||||
nextElement.IsEntered = true;
|
||||
|
Reference in New Issue
Block a user