protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            TurnJob turnJob = new TurnJob
            {
            };

            return(turnJob.Schedule(this, inputDeps));
        }
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        if (Settings.IsPlayerDead())
        {
            return(inputDeps);
        }

        var job = new TurnJob
        {
            playerPosition = Settings.PlayerPosition
        };

        return(job.Schedule(this, inputDeps));
    }
        protected override JobHandle OnUpdate(JobHandle handle)
        {
            var moveForwardJob       = new MoveForwardJob();
            var destroyGameObjectJob = new DestroyGameObjectJob();
            var turnJob  = new TurnJob();
            var chaseJob = new ChaseJob();

            handle = moveForwardJob.Schedule(this, handle);
            handle = destroyGameObjectJob.Schedule(this, handle);
            handle = turnJob.Schedule(this, handle);
            handle = chaseJob.Schedule(this, handle);

            return(handle);
        }
Example #4
0
        // =============================================================================================================
        /// <summary>
        /// The query above (our Job) will be called here.
        /// </summary>
        /// <param name="inputDeps">Our input dependencies.</param>
        /// <returns></returns>
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            if (GameSettings.Instance == null)
            {
                return(inputDeps);
            }

            //We can access MonoBehaviour here, as you can see.
            if (GameSettings.Instance.IsPlayerDead)
            {
                return(inputDeps);
            }

            //Create a new Job, set a value that our query needs and execute what we want.
            var job = new TurnJob
            {
                playerPosition = GameSettings.Instance.PlayerPosition
            };

            //Add to our job schedule and we are set.
            return(job.Schedule(this, inputDeps));
        }