示例#1
0
 // Use this for initialization
 void Start()
 {
     generator        = FindObjectOfType <FieldGenerator>();
     condition        = FindObjectOfType <Conditions>();
     manager          = FindObjectOfType <GameManager>();
     minesCount       = generator.GetMines();
     counterText.text = "Mines left: " + minesCount;
 }
示例#2
0
    public bool MinesLeft()
    {
        int totalMinesLeft = generator.GetMines();

        for (int i = 0; i < generator.GetLength(); i++)
        {
            for (int j = 0; j < generator.GetHeight(); j++)
            {
                if (field[i, j].GetMine() == true && field[i, j].GetFlagged() == true)
                {
                    totalMinesLeft--;
                }
            }
        }
        if (totalMinesLeft == 0)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }