public void RemoveEffects(TickEffect effect) { if (activeEffects.Contains(effect)) { activeEffects.Remove(effect); removedEffects.Add(effect); OnEffectChanged?.Invoke(); } else { Debug.LogError($"ActiveEffects does not contain this effect"); } }
public void RecompileEffect(object sender, FileSystemEventArgs e) { if (e.Name == FileName) { MonoGame.Framework.Content.Pipeline.Builder.PipelineManager PM = new MonoGame.Framework.Content.Pipeline.Builder.PipelineManager(Path, Path + "\\tempBin", "Path\\tempBin"); bool Worked = false; while (!Worked) { try { var BuiltContent = PM.BuildContent(Path + "\\" + FileName); var ProcessedContent = PM.ProcessContent(BuiltContent); OnEffectChanged?.Invoke(new Effect(Device, ((CompiledEffectContent)ProcessedContent).GetEffectCode())); Worked = true; File.Delete(Path + "\\tempBin\\" + FileName.TrimEnd(".fx".ToArray()) + ".xnb"); } catch (InvalidContentException E) { Common.Debug.DebugConsole?.Write("CompilerException"); Common.Debug.DebugConsole?.Write(E.Message); Worked = true; } }
public void AddEffect(TickEffect effect) { activeEffects.Add(effect); OnEffectChanged?.Invoke(); Debug.Log(activeEffects.Count); }