private static AnimationManager _this;//当前的对象,并且只有一个 public static AnimationManager _This { get { return _this; } }
private static Song _song; public static Song _Song{ get { if(_song==null){ _song=new Song(); } return _song; } }
单例可以方便的通过类名访问到那个唯一的实例进行操作
原文:http://www.cnblogs.com/sy88/p/3627789.html