コード例 #1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var actorOwnerFromEntity       = GetComponentDataFromEntity <ActorOwner>(true);
            var playerActorArrayFromEntity = GetComponentDataFromEntity <PlayerActorArray>();
            var slotFromEntity             = GetComponentDataFromEntity <Slot>(true);

            inputDeps = new WeaponUninstallJob
            {
                actorOwnerFromEntity       = actorOwnerFromEntity,
                playerActorArrayFromEntity = playerActorArrayFromEntity,
                slotFromEntity             = slotFromEntity,
            }
            .ScheduleSingle(this, inputDeps);

            inputDeps = new WeaponInstallJob
            {
                actorOwnerFromEntity       = actorOwnerFromEntity,
                playerActorArrayFromEntity = playerActorArrayFromEntity,
                slotFromEntity             = slotFromEntity,
            }
            .ScheduleSingle(this, inputDeps);


            inputDeps = new ShipDestroyMessageJob
            {
                Player_OnShipDestroy_NextFrameMessage = typeof(Player_OnShipDestroyMessage),
                endCommandBuffer = endBarrier.CreateCommandBuffer().ToConcurrent(),
            }
            .Schedule(this, inputDeps);

            endBarrier.AddJobHandleForProducer(inputDeps);
            return(inputDeps);
        }
コード例 #2
0
        /*[BurstCompile]
         * [ExcludeComponent(typeof(OnWeaponUninstallMessage))]
         * struct WeaponUpdateJob : IJobForEachWithEntity<WeaponInstalledState, RigidbodyVelocity>
         * {
         *  public ComponentDataFromEntity<Translation> translationFromEntity;
         *  public void Execute(Entity entity, int index, [ReadOnly] ref WeaponInstalledState weaponInstalledState, ref RigidbodyVelocity rigidbodyVelocity)
         *  {
         *      rigidbodyVelocity.linear = default;
         *
         *      translationFromEntity[entity] = translationFromEntity[weaponInstalledState.slotEntity];
         *  }
         * }*/

        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            inputDeps = new WeaponInstallJob {
            }.Schedule(this, inputDeps);
            inputDeps = new WeaponUninstallJob {
            }.Schedule(this, inputDeps);
            return(inputDeps);

            //var inputDepsA = new WeaponUpdateJob { translationFromEntity = GetComponentDataFromEntity<Translation>() }.ScheduleSingle(this, inputDeps);
            //return JobHandle.CombineDependencies(inputDepsA, inputDeps);
        }
コード例 #3
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            inputDeps = new WeaponUninstallJob
            {
                SlotUsingState = typeof(SlotUsingState),

                endCommandBuffer = endBarrier.CreateCommandBuffer().ToConcurrent(),
            }
            .Schedule(this, inputDeps);

            endBarrier.AddJobHandleForProducer(inputDeps);
            return(inputDeps);
        }
コード例 #4
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var shipWeaponArrayFromEntity = GetComponentDataFromEntity <ShipWeaponArray>();

            inputDeps = new WeaponUninstallJob
            {
                shipWeaponArrayFromEntity = shipWeaponArrayFromEntity,
            }
            .ScheduleSingle(this, inputDeps);

            inputDeps = new WeaponInstallJob
            {
                shipWeaponArrayFromEntity = shipWeaponArrayFromEntity,
            }
            .ScheduleSingle(this, inputDeps);

            return(inputDeps);
        }