Beispiel #1
0
 /**
  * @param none
  * @return none
  * Called based on clock time, checks to see if the level is over
  */
 void Update()
 {
     //Debug.Log("isLoading is: " + isLoading);
     if (SceneManager.GetActiveScene().isLoaded)
     {
         if (isLevelOver())
         {
             levelGenerator.ClearMap();
             Invoke("NextLevel", 1);
         }
     }
     GameVariables.LevelDuration += .02;
 }
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        //Reference to our script
        LevelGenerator levelGen = (LevelGenerator)target;

        //Only show the mapsettings UI if we have a reference set up in the editor
        if (levelGen.mapSetting != null)
        {
            Editor mapSettingEditor = CreateEditor(levelGen.mapSetting);
            mapSettingEditor.OnInspectorGUI();

            if (GUILayout.Button("Generate"))
            {
                levelGen.GenerateMap();
            }

            if (GUILayout.Button("Clear"))
            {
                levelGen.ClearMap();
            }
        }
    }