private void InitGenerator() { if (randomizeSeed) { config.seed = Random.Range(int.MinValue, int.MaxValue); } MapGenerator generator = new MapGenerator(config); CameraController = Camera.GetComponent <CustomCameraController>(); Map = generator.Generate(); }
private void RunMapGeneratorInEditor() { ClearGrid(); //update the last theme to be the current selected one in the inspector window lastGridTheme = generator.MapTheme; //let's assign some logging n all that pAction.ActionFailed += () => { Debug.Log(pAction.ErrorMessage); }; pAction.ActionSucceeded += () => { Debug.Log("<color=blue><b>Grid successfully generated!</b></color>"); }; //and now, lastly, let's call the generation of the map! pAction.Call(() => { generator.Generate(); }); }