fix: IGameObjects Not Being Initialized Properly

This commit is contained in:
2024-10-26 22:45:24 +03:00
parent 6bc9043a86
commit 24b50eba12
3 changed files with 23 additions and 6 deletions

View File

@@ -1,5 +1,7 @@
using System;
using Syntriax.Engine.Core.Exceptions;
namespace Syntriax.Engine.Core.Abstract;
public abstract class BaseEntity : IEntity
@@ -72,6 +74,8 @@ public abstract class BaseEntity : IEntity
UnassignInternal();
_stateEnable = null!;
_stateEnable.Unassign();
OnUnassigned?.Invoke(this);
return true;
}
@@ -82,6 +86,8 @@ public abstract class BaseEntity : IEntity
if (IsInitialized)
return false;
NotAssignedException.Check(this, _stateEnable);
InitializeInternal();
IsInitialized = true;