Ejemplo n.º 1
0
 /**
  * Starts shows UI for Playing (fade in needed elements / fades out not needed)
  */
 internal void ShowPlayUI()
 {
     _isPlaying = true;
     aboutPanel.SetActive(false);
     _scoreTextFader.Fade(true, .15f);
     _scoreTextShadowFader.Fade(true, .15f);
     menuManager.SetSound(_isSoundOn);
     menuManager.FadeOutMenu();
 }
Ejemplo n.º 2
0
 public void toLogin()
 {
     loginFade.Fade(FadeTransition.In);
     loginFade.GetComponent <CanvasGroup>().interactable   = true;
     loginFade.GetComponent <CanvasGroup>().blocksRaycasts = true;
     signUpFade.Fade(FadeTransition.Out);
     signUpFade.GetComponent <CanvasGroup>().interactable   = false;
     signUpFade.GetComponent <CanvasGroup>().blocksRaycasts = false;
 }
Ejemplo n.º 3
0
    }//end of AddToTime

    private void GameOverScreen()
    {
        gameActive = false;
        FindObjectOfType <AudioManager>().Stop("LevelTheme"); // Stops Level Theme and plays GameOverJingle
        FindObjectOfType <AudioManager>().Play("GameOverJingle", PlayerPrefs.GetFloat("MusicVol"));

        //Set the canvas to the in-game screen and fade it out with a coroutine
        canvGroup = inGameUI.GetComponent <CanvasGroup>();
        uiFader.Fade(canvGroup, false);

        //Set the canvas to the current screen and fade it in with a coroutine
        canvGroup = gameOverUI.GetComponent <CanvasGroup>();
        uiFader.Fade(canvGroup, true);
    }//end of GameOverScreen
Ejemplo n.º 4
0
 public void showLimit(PieceType type = PieceType.Attack){
     int lvl = GameManager.instance.UserInfoAct.userLvl+1;
     switch(menuCustomeAct){
         case "armesMelee":
         textLimit.text = nbPieceAtt.ToString() + " / " + _tPieceLimite[type][lvl]; 
         break;
         case "defense":
         textLimit.text = nbPieceDef.ToString() + " / " + _tPieceLimite[type][lvl]; 
         break;
         case "roues":
         textLimit.text = nbPieceMove.ToString() + " / " + _tPieceLimite[type][lvl]; 
         break;
     }
     fadeLimit.Fade(FadeTransition.In);
 }
Ejemplo n.º 5
0
    //shows a menu by name
    public void ShowMenu(string name, bool disableAllScreens)
    {
        if (disableAllScreens)
        {
            DisableAllScreens();
        }
        GameObject UI_Gameobject = null;

        foreach (UI_Screen UI in UIMenus)
        {
            if (UI.UI_Name == name)
            {
                UI_Gameobject = UI.UI_Gameobject;
            }
        }

        if (UI_Gameobject != null)
        {
            UI_Gameobject.SetActive(true);
        }
        else
        {
            Debug.Log("no menu found with name: " + name);
        }

        //fadeIn
        if (UI_fader != null)
        {
            UI_fader.gameObject.SetActive(true);
        }
        UI_fader.Fade(UIFader.FADE.FadeIn, 1f, .3f);
    }
Ejemplo n.º 6
0
    //restarts the current level
    void RestartLevel()
    {
        Time.timeScale = 1; //LETHAL FORCES

        if (!restartInProgress)
        {
            restartInProgress = true;

            //sfx
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            //button flicker
            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            //fade out
            fader.Fade(UIFader.FADE.FadeOut, 0.5f, 0.5f);

            //reload level
            Invoke("RestartScene", 1f);
        }
    }
Ejemplo n.º 7
0
 /**
  * Fades Out Game Menu
  */
 internal void FadeOutMenu()
 {
     gameTitleFader.Fade(false, fadeOutDuration);
     FadeAll(false, fadeOutDuration);
     newHighScoreFader.Fade(false, fadeOutDuration);
     if (_isSoundOff)
     {
         soundOffFader.Fade(false, 0f);
         soundOnFader.Fade(false, fadeOutDuration);
     }
     else
     {
         soundOnFader.Fade(false, 0f);
         soundOffFader.Fade(false, fadeOutDuration);
     }
 }
Ejemplo n.º 8
0
 /**
  * Fades In Game Menu
  */
 internal void FadeInMenu()
 {
     soundOffFader.Fade(false, 0);
     soundOnFader.Fade(false, 0);
     FadeAll(true, fadeInDuration);
     FadeInSound();
 }
Ejemplo n.º 9
0
    private IEnumerator changeScenefade(Scenes scene)
    {
        sliderLoad.value = 100;
        content.Fade(FadeTransition.Out);
        yield return(new WaitForSeconds(0.5f));

        GameManager.instance.changeScene(scene);
        yield return(null);
    }
Ejemplo n.º 10
0
    IEnumerator LoadSceneCoroutine(string sceneName)
    {
        loadSceneInProgress = true;

        //Fade out screen
        UIFader fader = GameObject.FindObjectOfType <UIFader>();

        if (fader != null)
        {
            fader.Fade(UIFader.FADE.FadeOut, 0.4f, 0.4f);
        }
        yield return(new WaitForSeconds(1f));

        //Load new scene
        SceneManager.LoadScene(sceneName);

        loadSceneInProgress = false;
    }
Ejemplo n.º 11
0
    /// <summary>
    /// 重打当前关卡
    /// </summary>
    void RestartLevel()
    {
        if (!restartInProgress)
        {
            restartInProgress = true;

            //播放音效
            GlobalAudioPlayer.PlaySFX("ButtonStart");

            ButtonFlicker bf = GetComponentInChildren <ButtonFlicker>();
            if (bf != null)
            {
                bf.StartButtonFlicker();
            }

            fader.Fade(UIFader.FADE.FadeOut, 0.5f, 0.5f);

            Invoke("RestartScene", 1f);
        }
    }
Ejemplo n.º 12
0
 // Use this for initialization
 void Start()
 {
     uiFader = this.GetComponent<UIFader>();
     uiFader.Fade(0, 0, EasingFunctions.TYPE.Out);
 }
 void ShowGameOverScrn()
 {
     fader.Fade(UIFader.FADE.FadeOut, .5f, 1);
     Invoke("ShowText", 1.4f);
 }
Ejemplo n.º 14
0
    private IEnumerator Start()
    {
        yield return(StartCoroutine(LoadSceneAndSetActive(startingSceneName)));

        StartCoroutine(uiFader.Fade(0f, 0f, false));
    }
Ejemplo n.º 15
0
 private void Start()
 {
     StartCoroutine(uiFader.Fade(0, 0, false));
 }
Ejemplo n.º 16
0
 void FadeIn()
 {
     UI_Fader.Fade(UIFader.FADE.FadeIn, .5f, 0f);
 }
 void ShowLevelCompleteScrn()
 {
     fader.Fade(UIFader.FADE.FadeOut, .5f, 1);
     Invoke("ShowText", 1.4f);
 }
Ejemplo n.º 18
0
 void Start()
 {
     content.Fade(FadeTransition.In);
 }