fix: UnAssign Problems

This commit is contained in:
2023-11-24 17:20:43 +03:00
parent 251bd948ab
commit d75bae802a
5 changed files with 11 additions and 7 deletions

View File

@@ -88,7 +88,7 @@ public class BehaviourController : IBehaviourController
public bool Assign(IGameObject gameObject)
{
if (GameObject.Initialized)
if (GameObject is not null && GameObject.Initialized)
return false;
_gameObject = gameObject;
@@ -98,7 +98,7 @@ public class BehaviourController : IBehaviourController
public bool Unassign()
{
if (GameObject.Initialized)
if (GameObject is not null && GameObject.Initialized)
return false;
_gameObject = null!;