Пример #1
0
    private void Awake()
    {
        scoreKeeper   = FindObjectOfType <ScoreKeeper>();
        mySceneLoader = FindObjectOfType <MySceneLoader>();

        currentScene = mySceneLoader.GetCurrentSceneName();

        DetectAndSetNewGame();
        PickRandomGameOrGoToRestart();
    }
Пример #2
0
 /// <summary>
 /// On Escape click event.
 /// </summary>
 public void OnEscapeClick()
 {
     if (leaveTheApplication)
     {
         GameObject exitConfirmDialog = GameObject.Find("ExitConfirmDialog");
         if (exitConfirmDialog != null)
         {
             Dialog exitDialogComponent = exitConfirmDialog.GetComponent <Dialog> ();
             if (!exitDialogComponent.animator.GetBool("On"))
             {
                 exitDialogComponent.Show();
                 //AdsManager.instance.ShowAdvertisment (AdsManager.AdAPI.AdEvent.Event.ON_SHOW_EXIT_DIALOG);
             }
         }
     }
     else
     {
         StartCoroutine(MySceneLoader.LoadSceneAsync(sceneName));
     }
 }
Пример #3
0
    private void Awake()
    {
        scoreKeeper   = FindObjectOfType <ScoreKeeper>();
        mySceneLoader = FindObjectOfType <MySceneLoader>();

        var currentScene = mySceneLoader.GetCurrentSceneName();

        if (currentScene.Equals("GameLobby"))
        {
            var currentLives = scoreKeeper.GetCurrentLives();

            if (currentLives > 0)
            {
                mySceneLoader.GetRandomGame_Delay();
            }
            else
            {
                mySceneLoader.GoToRestart_Delay();
            }
        }
    }
Пример #4
0
 /// <summary>
 /// Go to the Next shape.
 /// </summary>
 public void NextShape()
 {
     if (TableShape.selectedShape.ID >= 1 && TableShape.selectedShape.ID < ShapesTable.shapes.Count)
     {
         //Get the next shape and check if it's locked , then do not load the next shape
         if (TableShape.selectedShape.ID + 1 <= ShapesManager.instance.shapes.Count)
         {
             if (DataManager.IsShapeLocked(TableShape.selectedShape.ID + 1))
             {
                 //Play lock sound effectd
                 if (lockedSFX != null && effectsAudioSource != null)
                 {
                     CommonUtil.PlayOneShotClipAt(lockedSFX, Vector3.zero, effectsAudioSource.volume);
                 }
                 //Skip the next
                 return;
             }
         }
         TableShape.selectedShape = ShapesTable.shapes [TableShape.selectedShape.ID]; //Set the selected shape
         CreateShape();                                                               //Create new shape
     }
     else
     {
         if (TableShape.selectedShape.ID == ShapesTable.shapes.Count)
         {
             StartCoroutine(MySceneLoader.LoadSceneAsync("Album"));
         }
         else
         {
             //Play lock sound effectd
             if (lockedSFX != null && effectsAudioSource != null)
             {
                 CommonUtil.PlayOneShotClipAt(lockedSFX, Vector3.zero, effectsAudioSource.volume);
             }
         }
     }
 }
Пример #5
0
 public void LoadAlbumScene()
 {
     StartCoroutine(MySceneLoader.LoadSceneAsync("Album"));
 }
Пример #6
0
 public void LoadGameScene()
 {
     StartCoroutine(MySceneLoader.LoadSceneAsync("Game"));
 }
Пример #7
0
 public void LeaveApp()
 {
     StartCoroutine(MySceneLoader.LoadSceneAsync("BackCameraSceneChoose"));
 }