Advertisement
Shirai

Tạo một class có thể tự tạo instance.

Sep 21st, 2014
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using Microsoft.Xna.Framework.Content;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using Microsoft.Xna.Framework;
  7. using Microsoft.Xna.Framework.Graphics;
  8. namespace DemoRPG
  9. {
  10.     public class ScreenManager
  11.     {
  12.         private static ScreenManager instance;
  13.         public static ScreenManager Instance
  14.         {
  15.             get
  16.             {
  17.                 if (instance == null)
  18.                     instance = new ScreenManager();
  19.                 return instance;
  20.             }
  21.         }
  22.         public Vector2 Dismensions { private set; get; }
  23.         public ScreenManager()
  24.         {
  25.             Dismensions = new Vector2(640, 480);
  26.         }
  27.         public void LoadContent(ContentManager content)
  28.         { }
  29.         public void UnloadContent()
  30.         {
  31.  
  32.         }
  33.         public void Update(GameTime gameTime)
  34.         { }
  35.         public void Draw(SpriteBatch spriteBatch)
  36.         { }
  37.  
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement