Example #1
0
        override protected JobHandle OnUpdate(JobHandle inputDeps)
        {
            if (lineGroup.IsEmptyIgnoreFilter)
            {
                return(inputDeps);
            }
            var rendJob = new ChunkRenderJob();

            rendJob.lines = lineQueue;

            float astrWidth  = 30;
            float astrHeight = 30;

            rendJob.astrLineWidth = 2;
            rendJob.astrColor     = new float4(0.25f, 0.85f, 0.85f, 1);
            rendJob.astrTL        = new float3(-astrWidth / 2, -astrHeight / 2, 0);
            rendJob.astrTR        = new float3(astrWidth / 2, -astrHeight / 2, 0);
            rendJob.astrBL        = new float3(-astrWidth / 2, astrHeight / 2, 0);
            rendJob.astrBR        = new float3(astrWidth / 2, astrHeight / 2, 0);

            pulse += pulseDelta * Time.deltaTime;
            if (pulse > pulseMax)
            {
                pulse      = pulseMax;
                pulseDelta = -pulseDelta;
            }
            else if (pulse < pulseMin)
            {
                pulse      = pulseMin;
                pulseDelta = -pulseDelta;
            }

            rendJob.pulse = pulse;
            return(rendJob.Schedule(this, inputDeps));
        }
        override protected JobHandle OnUpdate(JobHandle inputDeps)
        {
            if (lineGroup.IsEmptyIgnoreFilter)
            {
                return(inputDeps);
            }
            var rendJob = new ChunkRenderJob();

            rendJob.lines = lineQueue;

            rendJob.bulletWidth = 2;
            float bulletLength = 2;

            rendJob.trailWidth = 4;
            float trailLength = 4;

            rendJob.bulletColor = new float4((float)0xfc / (float)255, (float)0x0f / (float)255,
                                             (float)0xc0 / (float)255, 1);
            rendJob.trailColor = new float4((float)0xfc / (float)255, (float)0x0f / (float)255,
                                            (float)0xc0 / (float)255, 0.25f);
            rendJob.bulletTop    = new float3(0, bulletLength / 2, 0);
            rendJob.bulletBottom = new float3(0, -bulletLength / 2, 0);
            rendJob.trailBottom  = new float3(0, -trailLength, 0);

            return(rendJob.Schedule(this, inputDeps));
        }
        override protected JobHandle OnUpdate(JobHandle inputDeps)
        {
            if (lineGroup.IsEmptyIgnoreFilter)
            {
                return(inputDeps);
            }
            var rendJob = new ChunkRenderJob();

            rendJob.lines = lineQueue;

            float shipWidth  = 10;
            float shipHeight = 20;

            rendJob.shipLineWidth = 2;
            rendJob.shipColor     = new float4(0.85f, 0.85f, 0.85f, 1);
            rendJob.shipTop       = new float3(0, shipHeight / 2, 0);
            rendJob.shipBL        = new float3(-shipWidth / 2, -shipHeight / 2, 0);
            rendJob.shipBR        = new float3(shipWidth / 2, -shipHeight / 2, 0);

            return(rendJob.Schedule(this, inputDeps));
        }