Esempio n. 1
0
        protected override JobHandle StartGeneration(JobHandle dependOn)
        {
            if (sourceType == SourceType.FromTheme)
            {
                return(deferred ? deferredHandler.ScheduleDeferredJobs(SourceMeshData, Temps, dependOn) :
                       immediateHandler.ScheduleImmediateJobs(SourceMeshData, Temps, dependOn));
            }
            else if (sourceType == SourceType.FromMeshFilters)
            {
                MeshCache meshCache;
                NativeArray <DataInstance> dataInstances;
                MeshCache.CreateCombinationData(meshFilters, out meshCache, Allocator.TempJob, out dataInstances, Allocator.TempJob);

                Temps.Add(meshCache);
                Temps.Add(dataInstances);

                immediateHandler = new Immediate(dataInstances);
                return(immediateHandler.ScheduleImmediateJobs(meshCache.MeshData, Temps, dependOn));
            }
            else if (sourceType == SourceType.FromMeshesAndMatrices)
            {
                MeshCache meshCache;
                NativeArray <DataInstance> dataInstances;
                MeshCache.CreateCombinationData(meshes, matrices, out meshCache, Allocator.TempJob, out dataInstances, Allocator.TempJob);

                Temps.Add(meshCache);
                Temps.Add(dataInstances);

                immediateHandler = new Immediate(dataInstances);
                return(immediateHandler.ScheduleImmediateJobs(meshCache.MeshData, Temps, dependOn));
            }

            return(dependOn);
        }
        public void AddNewTemp()
        {
            var temp     = model.AddNewTemp(SelectedPickableTemp);
            var newModel = new FanControllerTempViewModel(temp, model);

            Temps.Add(newModel);
            SelectedTemp = newModel;

            SelectedPickableTemp = null;
            UpdatePickableTemps();
        }
Esempio n. 3
0
        private void TempEntity(QTempEntityMessage msg)
        {
            switch (msg.Type)
            {
            case TempEntityType.Lightning1:
            case TempEntityType.Lightning2:
            case TempEntityType.Lightning3:
            case TempEntityType.Unknown_13:
                Temps.Add(new Lightning(msg.Origin, msg.TraceEndpos));
                break;

            case TempEntityType.Gunshot:
            case TempEntityType.Spike:
            case TempEntityType.SuperSpike:
            case TempEntityType.WizSpike:
            case TempEntityType.KnightSpike:
                Temps.Add(new Gunshot(msg.Origin));
                break;
            }
        }
Esempio n. 4
0
 protected void AddTemp(System.IDisposable temp)
 {
     Temps.Add(temp);
 }
Esempio n. 5
0
        private void UpdateEntity(QUpdateEntityMessage msg)
        {
            Entity e;

            if (!Entities.ContainsKey(msg.Entity))
            {
                e = new Entity()
                {
                    Parent = this, Number = msg.Entity
                };
                Entities[msg.Entity] = e;
            }
            else
            {
                e = Entities[msg.Entity];
            }

            if (e.Model == "progs/player.mdl" || e.Model == "progs/eyes.mdl")
            {
                Temps.Add(new Footstep(e.Origin));
            }

            if (msg.AnglesX.HasValue)
            {
                e.Angles.X = msg.AnglesX.Value;
            }
            if (msg.AnglesY.HasValue)
            {
                e.Angles.Y = msg.AnglesY.Value;
            }
            if (msg.AnglesZ.HasValue)
            {
                e.Angles.Z = msg.AnglesZ.Value;
            }
            if (msg.Colormap.HasValue)
            {
                e.Colormap = msg.Colormap.Value;
            }
            if (msg.Effects.HasValue)
            {
                e.Effects = msg.Effects.Value;
            }
            if (msg.Frame.HasValue)
            {
                e.Frame = msg.Frame.Value;
            }
            if (msg.ModelIndex.HasValue)
            {
                e.ModelIndex = msg.ModelIndex.Value;
            }
            if (msg.OriginX.HasValue)
            {
                e.Origin.X = msg.OriginX.Value;
            }
            if (msg.OriginY.HasValue)
            {
                e.Origin.Y = msg.OriginY.Value;
            }
            if (msg.OriginZ.HasValue)
            {
                e.Origin.Z = msg.OriginZ.Value;
            }
            if (msg.Skin.HasValue)
            {
                e.Skin = msg.Skin.Value;
            }
        }