public void LoadRandomStage() { Debug.Log("LoadRandom executed"); //stop all audio AudioManager.StopAll(); //clean ui bugg //GUIManager.Instance.EndOfRoundPanel.SetActive(false); if (shuffleBagIndex > shuffleBagStages.Count - 1) { shuffleBagIndex = 0; } int stageIndex = shuffleBagIndex; shuffleBagIndex++; currentStage = shuffleBagStages[stageIndex]; string lvlname = shuffleBagStages[stageIndex].levelname; DontDestroyOnLoad(gameObject); Debug.Log("trying to load " + lvlname); Application.LoadLevel(lvlname); GUIManager.Instance.MainMenu.SetActive(false); }
public void LoadNewStage() { int stageIndex = GUIManager.Instance.StageSelector.value; currentStage = _StagesDB[stageIndex]; string lvlname = _StagesDB[stageIndex].levelname; DontDestroyOnLoad(gameObject); Debug.Log("trying to load " + lvlname); Application.LoadLevel(lvlname); GUIManager.Instance.MainMenu.SetActive(false); //GUIManager.Instance.InstructionsPanel.SetActive(true); }
void Start() { //ReadStageAsset();//读取关卡文件 Stage = new StageClass(TaStageAsset.text); //关卡自动加载 GoPlayer.GetComponent <Rigidbody2D>().drag = FloPlayerRigidbodyDrag; //玩家刚体阻力初始化 _IntScore = 0; //分数初始化 _IntRhythmCombo = 0; //节奏连击初始化 _IntGrazeCombo = 0; //擦弹连击初始化 _IntDeathNumber = 0; //死亡次数初始化 AudioManager.SetAudioBackgroundVolumns(1.0F); AudioManager.SetAudioEffectVolumns(1.0F); //AudioManager.PlayAudioEffectA("GT"); //AudioManager.PlayAudioEffectA("RBP"); AudioManager.PlayAudioEffectA("GuillaumeTell"); _FloMusicStartTime = Time.timeSinceLevelLoad; }