Example #1
0
    private void Awake()
    {
        scoreKeeper   = FindObjectOfType <ScoreKeeper>();
        mySceneLoader = FindObjectOfType <MySceneLoader>();

        currentScene = mySceneLoader.GetCurrentSceneName();

        DetectAndSetNewGame();
        PickRandomGameOrGoToRestart();
    }
 /// <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));
     }
 }
Example #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();
            }
        }
    }
 /// <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);
             }
         }
     }
 }
Example #5
0
 public void LoadAlbumScene()
 {
     StartCoroutine(MySceneLoader.LoadSceneAsync("Album"));
 }
Example #6
0
 public void LoadGameScene()
 {
     StartCoroutine(MySceneLoader.LoadSceneAsync("Game"));
 }
Example #7
0
 public void LeaveApp()
 {
     StartCoroutine(MySceneLoader.LoadSceneAsync("BackCameraSceneChoose"));
 }