public void Init()
 {
     //初始化关卡信息
     level    = PlayerPrefs.GetInt(Util.INFINETE_LEVEL, Util.INFINETE_DEFULT_LEVEL);
     n        = PlayerPrefs.GetInt(Util.INFINETE_N, Util.INFINETE_DEFULT_N);
     detector = new DefaultDetecter();
     timer    = new GameTimer.Timer();
     GameTimer.instance.Add(timer);
     timeLabel = GameObject.Find("time").GetComponent <UILabel>();
 }
    private void startGameByLevel(int n, int level, _Point start = null, _Point end = null, int requestLeftNum = 0)
    {
        if (null == start || null == end)
        {
            _Point[] ps = Util.getRandomStartAndEndPoint(n, 2);
            start = ps[0];
            end   = ps[1];
        }
        if (requestLeftNum != 0)
        {
            detector           = new RemainStepDetecter();
            parmsForGameEnd    = new object[1];
            parmsForGameEnd[0] = requestLeftNum;
        }

        Cubes.instance.NewGame(start, end, n, level, requestLeftNum);
    }
 void Awake()
 {//单例模式
     instance = this;
     detector = new DefaultDetecter();
 }
 void Awake()
 {
     instance  = this;
     roadMaker = new GeneralRoadMaker();
     detector  = new DefaultDetecter();
 }