protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            JobHandle outputHandle = inputDeps;

            EntityArray destroyEntityArray = destroyEntityDataGroup.GetEntityArray();

            if (destroyEntityArray.Length > 0)
            {
                Entity destroyEntity = destroyEntityArray[0];
                ComponentDataFromEntity <DestroyEntityData> destroyEntityDataFromEntity = GetComponentDataFromEntity <DestroyEntityData>();

                DestroyEntityData destroyEntityData = destroyEntityDataFromEntity[destroyEntity];

                var outOfBoundJob = new EntityOutOfBoundJob
                {
                    outOfBoundEntityQueue           = destroyEntityData.entityOutOfBoundQueueConcurrent,
                    cameraPosition                  = MonoBehaviourECSBridge.Instance.gameCamera.transform.position,
                    halfFrustumHeightPreCalculation = Mathf.Tan(Camera.main.fieldOfView * 0.5f * Mathf.Deg2Rad),
                };

                outputHandle = outOfBoundJob.Schedule(this, inputDeps);
            }

            return(outputHandle);
        }
Exemple #2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var outOfBoundJob = new EntityOutOfBoundJob
            {
                entityArray = entityBoundDataGroup.entityArray,
                entityBoundCenterDataArray      = entityBoundDataGroup.entityBoundCenterDataArray,
                outOfBoundEntityQueue           = destroyEntityDataGroup.destroyEntityData[0].entityOutOfBoundQueueConcurrent,
                cameraPosition                  = MonoBehaviourECSBridge.Instance.gameCamera.transform.position,
                halfFrustumHeightPreCalculation = Mathf.Tan(Camera.main.fieldOfView * 0.5f * Mathf.Deg2Rad),
            };

            return(outOfBoundJob.Schedule(entityBoundDataGroup.Length,
                                          MonoBehaviourECSBridge.Instance.GetJobBatchCount(entityBoundDataGroup.Length),
                                          inputDeps));
        }