public static void ComponentReset() { EffectsMgr.Clear(); Sound.Clear(); GameTimer.ClearAllTimer(); TextEffectMgr.Clear(); GameManager.objMemoryMananger.ClearGroups(); DrawMgr.SetCondition(null); }
public static void UpdataComponent(float seconds) { GameManager.UpdateMgr.Update(seconds); GameManager.PhiColManager.Update(seconds); GameManager.ShelterMgr.Update(); GameManager.VisionMgr.Update(); GameManager.objMemoryMananger.Update(); EffectsMgr.Update(seconds); }
protected override void Initialize() { content = new ContentManager(Services); renderEngine = new RenderEngine(Device, content, "Content\\EngineContent"); effectMgr = new EffectsMgr(); RandomHelper.GenerateNewRandomGenerator(); Log.Initialize(); base.Initialize(); }
public ScaleUp(string texPath, Vector2 origin, float layerDepth, Vector2 pos, RadiusFunc radiusFunc, SingleFunc rotaFunc, float duration) { this.tex = BaseGame.ContentMgr.Load <Texture2D>(texPath); this.origin = origin; this.pos = pos; this.radiusFunc = radiusFunc; this.rotaFunc = rotaFunc; this.duration = duration; this.layerDepth = layerDepth; EffectsMgr.AddManagedEffect(this); }
public void Draw() { foreach (IEnumerable <IDrawableObj> group in drawableGroups) { foreach (IDrawableObj drawable in group) { if (condition != null) { if (condition(drawable)) { drawable.Draw(); } } else { drawable.Draw(); } } } EffectsMgr.Draw(condition); }
public SmokeGenerater(float duaration, float partiDuara, Vector2 pos, Vector2 dir, float speed, float concen, bool managered) { this.duaration = duaration; this.concen = concen; Texture2D tex = BaseGame.ContentMgr.Load <Texture2D>(texAsset); particleSystem = new ParticleSystem(duaration, partiDuara, pos, tex, texOrigin, null, LayerDepth.EffectLow + 0.01f, delegate(float curTime, ref float timer) { if (this.concen == 0) { return(0); } else if (this.concen > 1) { return((int)(this.concen)); } else if (curTime % (int)(1 / this.concen) == 0) { return(1); } else { return(0); } }, delegate(float curTime, float deltaTime, Vector2 lastPos, Vector2 curDir, int No) { if (curTime == 0) { return(Vector2.Zero + RandomHelper.GetRandomVector2(-1, 1)); } else { return(lastPos + curDir * speed); } }, delegate(float curTime, float deltaTime, Vector2 lastDir, int No) { if (curTime == 0) { return(dir + RandomHelper.GetRandomVector2(-0.3f, 0.3f)); } else { return(lastDir); } }, delegate(float curTime, float deltaTime, float lastRadius, int No) { return(startRadius * (1 + 0.1f * curTime)); }, delegate(float curTime, float deltaTime, Color lastColor, int No) { return(new Color(160, 160, 160, Math.Max((byte)0, (byte)(255 * (partiDuara - curTime) / partiDuara)))); }); if (managered) { EffectsMgr.AddManagedEffect(this); } }