Пример #1
0
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var job = new PlanetMovementSystemJob {
            deltaTime = Time.deltaTime * simRate
        };

        //a bit of cheating, I know there is only one sun for now
        return(job.Schedule(this, inputDependencies));
    }
Пример #2
0
        protected override JobHandle OnUpdate(JobHandle inputDependencies)
        {
            var job = new PlanetMovementSystemJob {
                activateThrust = RigidbodyData.Instance.engageThrust, deltaTime = Time.fixedDeltaTime
            };

            //a bit of cheating, I know there is only one sun for now

            return(job.Schedule(this, inputDependencies));
        }
Пример #3
0
    protected override JobHandle OnUpdate(JobHandle inputDependencies)
    {
        var job = new PlanetMovementSystemJob {
            G = 6.67300e-11f, deltaTime = Time.deltaTime * simRate
        };

        //a bit of cheating, I know there is only one sun for now
        job.bodyMasses       = GetEntityQuery(typeof(Mass)).ToComponentDataArray <Mass>(Allocator.TempJob);
        job.bodyTranslations = GetEntityQuery(typeof(Translation)).ToComponentDataArray <Translation>(Allocator.TempJob);

        return(job.Schedule(this, inputDependencies));
    }