internal void _UnregisterActor <TActor>(TActor actor) where TActor : Actor <TManager>
        {
            Type type = ((object)actor).GetType();

            if (!_actors.ContainsKey(type))
            {
                return;
            }
            _actors[type].Remove(actor);
            _actorsCache[type] = _actors[type].ToArray();
            _sActors.Remove(actor);
            Actors = _sActors.ToArray();
            actor._IsRegistered = false;
            actor._Destroy();

            CoreManager.Log(LogLevel.Info, $"{type} Unregistered!");
        }
        internal override bool _Awake()
        {
            if (Manager == null)
            {
                Manager = CoreManager._Instance._GetManager <TManager>();
            }
            if (Manager == null)
            {
                Object.Destroy(this);
                return(false);
            }
            TManager manager = Manager;

            manager._RegisterActor(this);

            Listen(true);
            CoreManager.Log(LogLevel.Info, "Listen status: True");

            return(true);
        }
        internal void _RegisterActor <TActor>(TActor actor) where TActor : Actor <TManager>
        {
            Type type = ((object)actor).GetType();

            if (!_actors.ContainsKey(type))
            {
                _actors.Add(type, new List <object>());
            }
            if (!_actorsCache.ContainsKey(type))
            {
                _actorsCache.Add(type, null);
            }
            _actors[type].Add(actor);
            _actorsCache[type] = _actors[type].ToArray();
            _sActors.Add(actor);
            Actors = _sActors.ToArray();
            actor._IsRegistered = true;

            CoreManager.Log(LogLevel.Info, $"{type} Registered!");
        }
 protected void Destroy()
 {
     CoreManager.Log(LogLevel.Warning, "Actor destroying...");
     _Destroy();
 }
 internal override void _Start()
 {
     Listen(true);
     CoreManager.Log(LogLevel.Info, "Listen status: True");
 }