Exemple #1
0
    //Adding a button to generate noise, or an option to do it automatically
    public override void OnInspectorGUI()
    {
        GenerateMap mapGen = (GenerateMap)target;

        //Automatic updating
        if (DrawDefaultInspector())
        {
            if (mapGen.autoUpdate)
            {
                mapGen.DrawMapInEditor();
            }
        }
        //Manual updating
        if (GUILayout.Button("Generate"))
        {
            mapGen.DrawMapInEditor();
        }
    }