akadoc/Assets/src/Game.cs

38 lines
474 B
C#
Raw Normal View History

2015-03-06 11:20:49 +00:00
using UnityEngine;
using System.IO;
public class Game {
2015-04-01 19:47:43 +00:00
public void SetMainPlayer(Game_Player p){
2015-03-06 11:20:49 +00:00
m_mainPlayer = p;
}
2015-04-01 19:47:43 +00:00
public Game_Player GetMainPlayer(){
2015-03-06 11:20:49 +00:00
return m_mainPlayer;
}
2015-03-06 11:37:52 +00:00
public static Game Get() {
2015-03-06 11:20:49 +00:00
lock(m_singlmutex) {
if(m_inst==null)
m_inst = new Game();
}
return m_inst;
}
private Game() {
}
private static Game m_inst = null;
private static object m_singlmutex = new Object();
2015-04-01 19:47:43 +00:00
private Game_Player m_mainPlayer = null;
2015-03-06 11:20:49 +00:00
}