Singleton 记录不同level的公共信息,玩家名字,经验等
From 呼吸的草稿本
http://www.unifycommunity.com/wiki/index.php?title=Singleton
The non-component example
<csharp>public class MySingleton { private static MySingleton instance;
public MySingleton() { if( instance != null ) { Debug.LogError( "Cannot have two instances of singleton. Self destruction in 3..." ); return; }
instance = this; }
public static MySingleton Instance { get { if( instance == null ) { new MySingleton(); }
return instance; } } }</csharp>