示例#1
0
        private void GetSavedEffects()
        {
            EffectsInProject.Clear();
            var foundParticles = service.GetAllContentNamesByType(ContentType.ParticleSystem);

            foreach (var particle in foundParticles)
            {
                EffectsInProject.Add(particle);
            }
        }
示例#2
0
        //ncrunch: no coverage end

        public void UpdateOnContentChange(ContentType type, string addedName)
        {
            if (type == ContentType.ParticleSystem && !EffectsInProject.Contains(addedName))
            {
                EffectsInProject.Add(addedName);
                RaisePropertyChanged("EffectsInProject");
            }
            if (type == ContentType.ParticleEmitter && !EmittersInProject.Contains(addedName))
            {
                EmittersInProject.Add(addedName);
                RaisePropertyChanged("EmittersInProject");
            }
            if (type == ContentType.Material && !MaterialList.Contains(addedName))
            {
                MaterialList.Add(addedName);
                RaisePropertyChanged("MaterialList");
            }
        }
示例#3
0
 public void UpdateOnContentDeletion(string removedName)
 {
     if (EffectsInProject.Contains(removedName))
     {
         EffectsInProject.Remove(removedName);
     }
     else if (EmittersInProject.Contains(removedName))
     {
         EmittersInProject.Remove(removedName);
     }
     else if (MaterialList.Contains(removedName))
     {
         MaterialList.Remove(removedName);
         foreach (var emitter in currentEffect.AttachedEmitters)
         {
             if (emitter.EmitterData.ParticleMaterial.Name.Equals(removedName))
             {
                 emitter.EmitterData.ParticleMaterial = ContentExtensions.CreateDefaultMaterial2D();                         //ncrunch: no coverage
             }
         }
     }
     RaisePropertyChanged("EffectsInProject");
 }