Example #1
0
    public void Process()
    {
        TimesProcessed++;

        if (Solid.Any())
        {
            Threader.Active.Enqueue(new Threader.Item()
            {
                ActionASync       = AsyncProcess,
                PostActionSync    = SyncProcess,
                Context           = this,
                PriorityData      = new Vector3(VX, 0, VZ),
                PriorityThreshold = -GlobalSettings.Active.MaxVisibilityRadius,
                PriorityResolver  = (d) =>
                {
                    return(-Vector3.Distance((Vector3)d, Camera.main.transform.position.GetFlatCoord()));
                },
                Tag = "Terrain"
            });
        }

        if (Liquid.Any())
        {
            Threader.Active.Enqueue(new Threader.Item()
            {
                ActionASync       = AsyncProcess,
                PostActionSync    = SyncProcess,
                Context           = this,
                PriorityData      = new Vector3(VX, 0, VZ),
                PriorityThreshold = -GlobalSettings.Active.MaxVisibilityRadius,
                PriorityResolver  = (d) =>
                {
                    return(-Vector3.Distance((Vector3)d, Camera.main.transform.position.GetFlatCoord()));
                },
                Tag = "Liquid"
            });
        }
    }