public override void OnInspectorGUI()
    {
        //Called whenever the inspector is drawn for this object.,
        Dungeonizer realscript = (Dungeonizer)target;

        if (realscript.minRoomSize > realscript.maxRoomSize)
        {
            EditorGUILayout.HelpBox("Please make sure your minumum room size isn't bigger than maximum room size.", MessageType.Error);
        }
        EditorGUILayout.HelpBox("Follow us, Lets Make Dungeons Together: https://www.twitch.tv/dungeonizer", MessageType.Info);


        DrawDefaultInspector();
        //This draws the default screen.  You don't need this if you want
        //to start from scratch, but I use this when I'm just adding a button or
        //some small addition and don't feel like recreating the whole inspector.



        if (GUILayout.Button("Create Now"))
        {
            //add everthing the button would do.
            realscript.ClearOldDungeon(true);
            realscript.Generate();
        }
    }
Exemple #2
0
    public IEnumerator dungeonStarter()
    {
        SpawnOption easyFood = new SpawnOption();

        easyFood.maxSpawnCount = 10;
        easyFood.minSpawnCount = 10;
        easyFood.spawnRoom     = 0;
        easyFood.spawnByWall   = false;
        easyFood.gameObject    = chest;


        if (difficulty == "easy")
        {
            dungeonizer.maximumRoomCount = 10;
            dungeonizer.spawnOptions[0]  = easyFood;
        }
        else if (difficulty == "hard")
        {
            dungeonizer.maximumRoomCount = 20;
        }
        else
        {
            dungeonizer.maximumRoomCount = 50;
        }

        Debug.Log("START");
        dungeonizer.Generate();              //generates
        yield return(new WaitForSeconds(0)); //<-- here

        loadingScreen.SetActive(false);
        Debug.Log("GENERATED");
    }
Exemple #3
0
    public void NewLevel()
    {
        Dungeonizer dungeonizer = GetComponent <Dungeonizer>();

        dungeonizer.ClearOldDungeon();
        dungeonizer.Generate();

        StartCoroutine(Respawn());
        Debug.Log("Locating Player");
        //DungeonGenLibrary.Tile t;
    }
    public IEnumerator dungeonTimer()
    {
        // This means you can create a new dungeon whenever you want.
        Dungeonizer d = dungeonizer.GetComponent("Dungeonizer") as Dungeonizer;

        d.ClearOldDungeon();
        d.Generate();

        yield return(new WaitForSeconds(0.3f));

        StartCoroutine(dungeonTimer());
    }
Exemple #5
0
    public override void OnInspectorGUI()
    {
        //Called whenever the inspector is drawn for this object.
        DrawDefaultInspector();
        //This draws the default screen.  You don't need this if you want
        //to start from scratch, but I use this when I'm just adding a button or
        //some small addition and don't feel like recreating the whole inspector.
        Dungeonizer realscript = (Dungeonizer)target;

        if (GUILayout.Button("Create Now"))
        {
            //add everthing the button would do.
            realscript.ClearOldDungeon(true);
            realscript.Generate();
        }
    }