///////////////////////////////////////////

        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();
        }
Exemple #5
0
 ///////////////////////////////////////////
 public JigsawPuzzleManager()
 {
     if( instance != null )
         Log.Fatal( "JigsawPuzzleManager: instance already created." );
     instance = this;
 }
Exemple #6
0
        /// <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;
        }