示例#1
0
    public void LoadScene(GAMESCENE gameScene)
    {
        switch (gameScene)
        {
        case GAMESCENE.WELCOME:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.LOGINREGISTRATION:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.MAINMENU:
            SceneManager.LoadScene(3);
            break;

        case GAMESCENE.GAME:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.LOADING:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.NONE:
            Application.Quit();
            break;

        default:
            break;
        }
    }
示例#2
0
 /// <summary>
 /// Load scene in Game
 /// </summary>
 /// <param name="_scene"></param>
 public void loadScene( GAMESCENE _scene )
 {
     switch(_scene)
     {
             //Implementation
         case GAMESCENE.LOGO :
             Application.LoadLevel("Logo");
             break;
         case GAMESCENE.GAME :
             Application.LoadLevel("Nivel");
             break;
         case GAMESCENE.MENU :
             Application.LoadLevel("Menu");
             break;
         default:
             Application.LoadLevel("Logo");
             break;
     }
 }
示例#3
0
    public void LoadSceneAsync(GAMESCENE gameScene)
    {
        Debug.Log("Enter Load Async");
        asyncOperations.Clear();
        int currentSceneIndex = SceneManager.GetActiveScene().buildIndex;
        int sceneIndex        = 0;

        switch (gameScene)
        {
        case GAMESCENE.WELCOME:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.LOGINREGISTRATION:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.MAINMENU:
            Debug.Log("Enter Load Async SWITCH");
            sceneIndex = 3;
            break;

        case GAMESCENE.GAME:
            sceneIndex = 2;
            break;

        case GAMESCENE.LOADING:
            SceneManager.LoadScene(0);
            break;

        case GAMESCENE.NONE:
            Application.Quit();
            break;

        default:
            break;
        }
        asyncOperations.Add(SceneManager.UnloadSceneAsync(currentSceneIndex));
        asyncOperations.Add(SceneManager.LoadSceneAsync(sceneIndex));
        LoadingScreen();
    }
示例#4
0
 public void loadSceneWithFade(GAMESCENE _scene)
 {
     Game_Fade.Instance.playFadeIn(_scene);
 }
示例#5
0
 public void ChangeScene(GAMESCENE s)
 {
     SceneManager.LoadSceneAsync((int)s);
 }
示例#6
0
 public void playFadeIn(GAMESCENE _scene)
 {
     if (Game_Actions.Instance.event_fadeIn != null) Game_Actions.Instance.event_fadeIn();
     this.fadeAnim.SetTrigger("FadeIn");
     this.scene = _scene;
 }
示例#7
0
 public void loadingScene()
 {
     Game_Director.Instance.loadScene(this.scene);
     this.scene = GAMESCENE.NULL;
 }