Unity 5.3 How to load current level?

后端 未结 4 703
暗喜
暗喜 2020-12-11 01:14

before Unity 5.3, I could do

Application.LoadLevel(Application.loadedLevel);

But now it\'s something weird with SceneManager. I\'ve read d

4条回答
  •  感情败类
    2020-12-11 01:38

    using UnityEngine;    
    using UnityEngine.UI;   
    using System;   
    using System.Collections;  
    **using UnityEngine.SceneManagement;**
    
    public class UIManager : MonoBehaviour{
    
    public void OnRoomJoin(BaseEvent e)
        {   
    
            // Remove SFS2X listners and re-enable interface before moving to the main game scene
            //Reset();
    
            // Goto the main game scene
            **SceneManager.LoadScene(1);**
    //     **SceneManager.LoadScene("main");**  
        }   
    }
    

提交回复
热议问题