akadoc/Assets/src/Game.cs

38 lines
459 B
C#
Raw Normal View History

2015-03-06 11:20:49 +00:00
using UnityEngine;
using System.IO;
public class Game {
2015-03-06 11:37:52 +00:00
public void SetMainPlayer(Player p){
2015-03-06 11:20:49 +00:00
m_mainPlayer = p;
}
2015-03-06 11:37:52 +00:00
public 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();
private Player m_mainPlayer = null;
}