public void CreateMap(MapIndex mapIndex) { string mapName = MapIndexConfig.GetMapNameByMapIndex(mapIndex); string mapPath = FolderMgr.GetMapPrefabPath(); string mapFrefab = mapPath + "/" + mapName; Object obj = Resources.Load(mapFrefab); if (obj == null) { Debug.Log("path is " + mapFrefab); return; } GameObject instance = GameObject.Instantiate(obj) as GameObject; }