Beispiel #1
0
        public SystemParallelPipeline(TSystem[] systems)
        {
            _systems = systems;
            _update  = ECSUtils.BuildSystemUpdateMethod <TSystem>();

            _buffer = new Task[systems.Length];
        }
Beispiel #2
0
 public void TryRegister(DependencyCollection collection, Type implementation)
 {
     if (ECSUtils.TryGetImplementedSystemInterfaces(implementation, out var contracts))
     {
         collection.AddDependency(contracts, implementation, _lifetime);
     }
 }
Beispiel #3
0
        public static DependencyCollection AddSystem <TSystem>(
            this DependencyCollection dependencies,
            DependencyLifetime lifetime = DependencyLifetime.Singleton)
        {
            var implementation = typeof(TSystem);

            if (!ECSUtils.TryGetImplementedSystemInterfaces(implementation, out var contracts))
            {
                throw Error.InvalidOperation(
                          $"Type '{ReflectionUtils.GetName<TSystem>()}' isn't implemented system interfaces");
            }

            dependencies.AddDependency(contracts, implementation, lifetime);
            return(dependencies);
        }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     if (Instance == null)
     {
         Destroy(Instance);
     }
     Instance = this;
     if (L == null)
     {
         L = new XLua.LuaEnv();
         L.DoString("require ('Main')");
         L.DoString("OnStart()");
     }
     ECSUtils.Setup();
 }
 public SystemSequentialPipeline(TSystem[] systems)
 {
     _systems = systems;
     _update  = ECSUtils.BuildSystemUpdateMethod <TSystem>();
 }
Beispiel #6
0
 public SystemSinglePipeline(TSystem system)
 {
     _system = system;
     _update = ECSUtils.BuildSystemUpdateMethod <TSystem>();
 }