public void initGameManager() { // <setup ALL THE STUFF> playerScript = GetComponent <PlayerScript>(); Sprite t = TilePrefab.GetComponent <SpriteRenderer>().sprite; cellHeight = t.textureRect.height / t.pixelsPerUnit; cellWidth = t.textureRect.width / t.pixelsPerUnit; GameGrid.GetComponent <RectTransform>().sizeDelta = new Vector3(mapWidth * cellWidth, mapHeight * cellHeight); if (bgmSource) { bgmSource.clip = StaticResourceProvider.GetClip(string.IsNullOrEmpty(bgmName) ? "RandomStage" : bgmName); bgmSource.Stop(); bgmSource.Play(); } // </setup> }
public static List <GameObject> LoadMapFromResources(string mapName, GameObject tileControllerPrefab, bool replaceLayers = false) { return(LoadMapFromFile("", tileControllerPrefab, replaceLayers, StaticResourceProvider.GetMapJSONObject(mapName))); }