예제 #1
0
    // private List<Edge> allEdges;


    //TODO Remove this when publishing, change to pick a random map (and remove the prebuilt map from the scene in the editor)
    void Awake()
    {
        //GETS MESH WHEN GAME IS RUNNING
        if (Application.isPlaying)
        {
            meshManager = GetComponent <MapMeshManager>();
            meshManager.DestroyAllChildren();
            meshManager.DestroyWallMesh();
            GenerateMap();
        }
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        MapMeshManager mapMesh = target as MapMeshManager;

        if (GUILayout.Button("DestroyMesh"))
        {
            mapMesh.DestroyAllChildren();
            mapMesh.DestroyWallMesh();
            mapMesh.DestroyColliders();
        }
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        MapManager     map     = target as MapManager;
        MapMeshManager mapMesh = map.GetComponent <MapMeshManager> ();

        if (GUILayout.Button("Generate Map"))
        {
            mapMesh.DestroyAllChildren();
            mapMesh.DestroyWallMesh();
            map.GenerateMap();
        }
    }