コード例 #1
0
    public bool DeactivateMine()
    {
        if (revealed)
        {
            return(true);
        }
        revealed = true;
        GetComponent <BoxCollider>().enabled = false;

        if (hasMine)
        {
            hasMine        = false;
            material.color = GREEN_SOLID;
            GridGenerator.ApplyToNeighbours(position.x, position.y, position.z, x => x.DecreaseCounter());
            ShowText();
            return(true);
        }
        else
        {
            material.color = YELLOW_SOLID;
            return(false);
        }
    }