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

            _buffer = new Task[systems.Length];
        }
Exemplo n.º 2
0
 public void TryRegister(DependencyCollection collection, Type implementation)
 {
     if (ECSUtils.TryGetImplementedSystemInterfaces(implementation, out var contracts))
     {
         collection.AddDependency(contracts, implementation, _lifetime);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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();
 }
Exemplo n.º 5
0
 public SystemSequentialPipeline(TSystem[] systems)
 {
     _systems = systems;
     _update  = ECSUtils.BuildSystemUpdateMethod <TSystem>();
 }
Exemplo n.º 6
0
 public SystemSinglePipeline(TSystem system)
 {
     _system = system;
     _update = ECSUtils.BuildSystemUpdateMethod <TSystem>();
 }