示例#1
0
    public void SetupNewGame()
    {
        if (CellCollector != null)
        {
            CellCollector.DestroyObjects();
        }

        int width  = Width;
        int height = Height;
        int mine   = MineCount;

        FloorLeft = width * height - mine;
        if (FloorLeft <= 0)
        {
            throw new UnityException("无效的初始化数据");
        }
        IsUserInterface = true;

        CellCollector = new CellCollection(this, GOFloor, width, height, mine);
        CellCollector.ShowUserInterFace();
        CurrentTurn = TurnType.WaitForFinish;
        UpdateButtons();
    }