public void GetRoomData(LevelImport li) { li.dataAsset = (TextAsset)levelDat[currentLevel]; li.currentSprite = (Sprite)levelPic[currentLevel]; gameObject.GetComponent <AudioSource>().clip = musicToUse[currentLevel]; li.isFirstLevel = currentLevel == 0 ? true : false; li.LoadLevel(); pt = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PlayerTracker>(); pt.SetRightEdge(li.GetRoomWidth()); gameObject.GetComponent <AudioSource>().loop = true; gameObject.GetComponent <AudioSource>().Play(); }