public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            if (minesweeper.grid.Length <= 0)
            {
                if (GUILayout.Button("Generate Random Grid", EditorStyles.miniButton))
                {
                    minesweeper.Randomize();
                }
            }
            else
            {
                if (GUILayout.Button("Update Random Grid", EditorStyles.miniButton))
                {
                    minesweeper.Randomize();
                }
            }

            EditorUtility.SetDirty(minesweeper);
        }
Exemplo n.º 2
0
 private void Awake()
 {
     minesweeperPlayground.Randomize();
 }