Example #1
0
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var settings        = GetSingleton <AntManagerSettings>();
        var obstacleSpawner = GetSingleton <ObstacleSpawner>();
        var obstacleBuckets = GetSingleton <ObstacleBuckets>();

        var colonyPositions = colonyQuery.ToComponentDataArrayAsync <Position>(Allocator.TempJob, out JobHandle colonyHandle);

        inputDependencies = JobHandle.CombineDependencies(inputDependencies, colonyHandle);

        //@TODO: split?
        var job = new MovementSystemJob
        {
            DeltaTime        = World.Time.DeltaTime,
            MapSize          = settings.MapSize,
            OutwardStrength  = settings.OutwardStrength,
            InwardStrength   = settings.InwardStrength,
            ColonyPosition   = colonyPositions,
            ObstacleRadius   = obstacleSpawner.ObstacleRadius,
            BucketResolution = settings.BucketResolution,
            OstacleBuckets   = obstacleBuckets,
            HasFoodComponent = GetComponentDataFromEntity <TagAntHasFood>(true)
        };

        return(job.Schedule(this, inputDependencies));
    }
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var job = new MovementSystemJob();

        job.deltaTime = UnityEngine.Time.deltaTime;

        return(job.Schedule(this, inputDependencies));
    }
Example #3
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new MovementSystemJob
            {
                DeltaTime = Time.DeltaTime
            };

            return(job.Schedule(this, inputDeps));
        }
Example #4
0
        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            var moveJob = new MovementSystemJob();

            moveJob.deltaTime = Time.deltaTime;

            // Now that the job is set up, schedule it to be run.
            return(moveJob.Schedule(this, inputDependencies));
        }
        // =============================================================================================================
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new MovementSystemJob();

            job.deltaTime = Time.deltaTime;

            var jobHandle = job.Schedule(this, inputDeps);

            return(jobHandle);
        }
Example #6
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        var job = new MovementSystemJob()
        {
            delta  = Time.deltaTime,
            width  = GameManagerScript.Width * 2,
            height = GameManagerScript.Height * 2,
            wrap   = false,
            radius = 0.5f,
        };
        var handle = job.Schedule(this, inputDeps);

        return(handle);
    }
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var job = new MovementSystemJob();

        // Assign values to the fields on your job here, so that it has
        // everything it needs to do its work when it runs later.
        // For example,
        //     job.deltaTime = UnityEngine.Time.deltaTime;

        job.deltaMovementWithDeltaTime = BeltObject.beltItemSlotDistance * BeltMaster.beltUpdatePerSecond * Time.DeltaTime;


        // Now that the job is set up, schedule it to be run.
        return(job.Schedule(this, inputDependencies));
    }
        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            if (GameManager.GM != null)
            {
                var moveJob = new MovementSystemJob()
                {
                    topBound    = GameManager.GM.topBound,
                    bottomBound = GameManager.GM.bottomBound,
                    deltaTime   = Time.deltaTime
                };

                return(moveJob.Schedule(this, inputDependencies));
            }
            return(inputDependencies);
        }
Example #9
0
        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            var job = new MovementSystemJob
            {
                deltaTime = Time.DeltaTime
            };

            // Assign values to the fields on your job here, so that it has
            // everything it needs to do its work when it runs later.
            // For example,
            //     job.deltaTime = UnityEngine.Time.deltaTime;



            // Now that the job is set up, schedule it to be run.
            return(job.Schedule(this, inputDependencies));
        }