Beispiel #1
0
 public RegisterJob()
 {
     _scope = ContainerConfig.Configure().BeginLifetimeScope();
     _cs    = _scope.Resolve <CopySource>();
     _idb   = _scope.Resolve <InitializeDatabase>();
     _iwh   = _scope.Resolve <InitializeWebHost>();
     _iws   = _scope.Resolve <InitializeWindowService>();
     _us    = _scope.Resolve <UninstallJob>();
 }
Beispiel #2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            inputDeps = new UninstallJob
            {
                OnWeaponUninstallMessage = typeof(OnWeaponUninstallMessage),
                ctrlCommandBuffer        = controlBarrier.CreateCommandBuffer().ToConcurrent(),
                endCommandBuffer         = endBarrier.CreateCommandBuffer().ToConcurrent(),

                Weapon_OnShipDestroyMessageFromEntity = GetComponentDataFromEntity <Weapon_OnShipDestroyMessage>(true),
            }
            .Schedule(this, inputDeps);

            inputDeps.Complete();//ChangedFilter 需要inputDeps.Complete()

            var translationFromEntity = GetComponentDataFromEntity <Translation>(true);

            inputDeps = new FirePrepareJob
            {
                powerFromEntity       = GetComponentDataFromEntity <ActorAttribute3 <_Power> >(true),
                translationFromEntity = translationFromEntity,
            }
            .Schedule(this, inputDeps);


            inputDeps = new FireDirectionJob
            {
                slotRotationFromEntity  = GetComponentDataFromEntity <Rotation>(true),
                weaponControlFromEntity = GetComponentDataFromEntity <WeaponControl>(true),
            }
            .Schedule(this, inputDeps);

            /*inputDeps = new FollowShipJob
             * {
             *  translationFromEntity = translationFromEntity
             * }
             * .Schedule(this, inputDeps);*/


            //
            inputDeps = new FireJobA
            {
                fixedDeltaTime = Time.fixedDeltaTime,

                OnWeaponControlFirePrepareMessage = typeof(OnWeaponControlFirePrepareMessage),
                ctrlCommandBuffer = controlBarrier.CreateCommandBuffer().ToConcurrent(),
                endCommandBuffer  = endBarrier.CreateCommandBuffer().ToConcurrent(),

#if false
                OnWeaponControlFireOnMessage          = typeof(OnWeaponControlFireOnMessage),
                weaponControlInFireStateCommandBuffer = weaponControlInFireStateCommandBuffer.ToConcurrent(),
#endif
            }
            .Schedule(this, inputDeps);

            /*inputDeps = new FireJobB
             * {
             *  fixedDeltaTime = Time.fixedDeltaTime,
             *
             *  OnWeaponControlFirePrepareMessage = typeof(OnWeaponControlFirePrepareMessage),
             *  ctrlCommandBuffer = controlBarrier.CreateCommandBuffer().ToConcurrent(),
             *  endCommandBuffer = endBarrier.CreateCommandBuffer().ToConcurrent(),
             * }
             * .Schedule(this, inputDeps);*/

#if false
            inputDeps = new WeaponFireStateJob
            {
                fixedDeltaTime = Time.fixedDeltaTime,

                WeaponControlInFireState      = typeof(WeaponControlInFireState),
                OnWeaponControlFireOffMessage = typeof(OnWeaponControlFireOffMessage),
                commandBuffer    = controlBarrier.CreateCommandBuffer().ToConcurrent(),
                endCommandBuffer = endBarrier.CreateCommandBuffer().ToConcurrent(),
            }
            .Schedule(this, inputDeps);

            weaponControlInFireStateCommandBuffer.Playback(EntityManager);
#endif


            controlBarrier.AddJobHandleForProducer(inputDeps);
            //endBarrier.AddJobHandleForProducer(inputDeps);
            return(inputDeps);
        }