示例#1
0
 public static Generator GetInstance(Func<Node> getRoot)
 {
     if (_instance == null) {
         lock (_lock) {
             if (_instance == null) {
                 var root = getRoot();
                 _instance = new Generator(root);
             }
         }
     }
     return _instance;
 }
 public void Setup()
 {
     _generator = Generator.GetInstance(() => _root);
 }