public static MapGenerator GetMapGenerator() { if(mapInstance == null) { mapInstance = FindObjectOfType<MapGenerator>(); if(mapInstance) { mapInstance.Init(); } } return mapInstance; }
void Awake() { mapInstance = this; Init(); }