Ejemplo n.º 1
0
 public override void Preview(string contentName)
 {
     var particleSystemData = ContentLoader.Load<ParticleSystemData>(contentName);
     var system = new ParticleSystem(particleSystemData);
     system.Position = new Vector3D(0.5f, 0.5f, 0);
 }
Ejemplo n.º 2
0
 public bool TryLoadingEffect(string effectName)
 {
     if (!ContentLoader.Exists(effectName, ContentType.ParticleSystem))
         return false;
     try
     {
         var effectData = ContentLoader.Load<ParticleSystemData>(effectName);
         DestroyAllEmitters();
         currentEffect = new ParticleSystem(effectData);
         currentEmitterInEffect = 0;
         RefreshAllEffectProperties();
         RaisePropertyChanged("AvailableEmitterIndices");
         CenterViewOnCurrentEffect();
         return true;
     }
     //ncrunch: no coverage start
     catch
     {
         Logger.Warning("Failed to load particle effect " + effectName);
         ResetDefaultEffect();
         return false;
     }//ncrunch: no coverage end
 }
Ejemplo n.º 3
0
 private void SetInitialDefaults()
 {
     TemplateListVisibility = Visibility.Hidden;
     SavedEmitterSelectionVisibility = Visibility.Hidden;
     currentEmitterInEffect = 0;
     ParticleSystemName = "MyParticleSystem";
     OverwriteOnSave = true;
     if (ContentLoader.Exists(ParticleSystemName, ContentType.ParticleSystem))
     { //ncrunch: no coverage start
         LoadEffect();
         CenterViewOnCurrentEffect();
         return;
     } //ncrunch: no coverage end
     currentEffect = new ParticleSystem();
     AddEmitterToSystem();
     CenterViewOnCurrentEffect();
 }
Ejemplo n.º 4
0
 public void ResetDefaultEffect()
 {
     ParticleSystemName = "";
     DestroyAllEmitters();
     currentEffect = new ParticleSystem();
     currentEmitterInEffect = 0;
     CenterViewOnCurrentEffect();
     AddEmitterToSystem();
     RefreshAllEffectProperties();
     RaisePropertyChanged("AvailableEmitterIndices");
     SavedEmitterSelectionVisibility = Visibility.Hidden;
     RaisePropertyChanged("SavedEmitterSelectionVisibility");
     TemplateListVisibility = Visibility.Hidden;
     RaisePropertyChanged("TemplateListVisibility");
 }