예제 #1
0
 public void Unload()
 {
     if (plugin != null)
     {
         var container      = EcsRxApplicationBehaviour.Instance.Container;
         var systemExecutor = EcsRxApplicationBehaviour.Instance.SystemExecutor;
         plugin.GetSystemsForRegistration(container)
         .ForEachRun(x => systemExecutor.RemoveSystem(x));
         plugin.UnsetupDependencies(container);
         plugin = null;
     }
 }
예제 #2
0
        T load <T>() where T : IEcsRxPlugin, new()
        {
            Unload();

            plugin = new T();

            var container      = EcsRxApplicationBehaviour.Instance.Container;
            var systemExecutor = EcsRxApplicationBehaviour.Instance.SystemExecutor;

            plugin.SetupDependencies(container);
            plugin.GetSystemsForRegistration(container)
            .ForEachRun(x => systemExecutor.AddSystem(x));

            return((T)plugin);
        }