/////////////////////////////////////////// public JigsawPuzzleManager() { if (instance != null) { Log.Fatal("JigsawPuzzleManager: instance already created."); } instance = this; }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary> protected override void OnPostCreate(bool loaded) { instance = this;//for undo support base.OnPostCreate(loaded); SubscribeToTickEvent(); //generate puzzles if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle()) ServerOrSingle_GeneratePuzzles(new Vec2I(8, 6)); CreateBackgroundImageMeshObject(); }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary> protected override void OnDestroy() { base.OnDestroy(); DestroyBackgroundImageMeshObject(); if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle()) { ServerOrSingle_DestroyPuzzles(); } if (instance == this) //for undo support { instance = null; } }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary> protected override void OnPostCreate(bool loaded) { instance = this; //for undo support base.OnPostCreate(loaded); SubscribeToTickEvent(); //generate puzzles if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle()) { ServerOrSingle_GeneratePuzzles(new Vec2I(8, 6)); } CreateBackgroundImageMeshObject(); }
/////////////////////////////////////////// public JigsawPuzzleManager() { if( instance != null ) Log.Fatal( "JigsawPuzzleManager: instance already created." ); instance = this; }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary> protected override void OnDestroy() { base.OnDestroy(); DestroyBackgroundImageMeshObject(); if( EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle() ) ServerOrSingle_DestroyPuzzles(); if( instance == this )//for undo support instance = null; }