void Update()
 {
     menuMaterial.SetFloat("_Completion", Completion);
     if (menuScript.terminate)
     {
         menuScript.terminate = false;
         Controller.SetTrigger("MenuFadeOut");
     }
     if (Completion == 0.0f)
     {
         Time.timeScale = 1;
         PhotonEngine_Play d = GameObject.Find("Main Camera").GetComponent <PhotonEngine_Play>() as PhotonEngine_Play;
         d.mnu = 0;
         gameObject.SetActive(false);
     }
 }
Beispiel #2
0
    void OnEnable()
    {
        refer   = Instantiate(FadeOutPrefabInstance);
        level   = SceneManager.GetActiveScene().buildIndex;
        tcScore = GameObject.Find("points_score").GetComponent <Text>();
        tbScore = GameObject.Find("best_score").GetComponent <Text>();
        PhotonEngine_Play aux = GameObject.Find("Main Camera").GetComponent <PhotonEngine_Play> ();

        cScore = aux.getPoints();
        bScore = PlayerPrefs.GetInt("bScore" + level, 0);
        if (cScore > bScore)
        {
            bScore = cScore;
            PlayerPrefs.SetInt("bScore" + level, bScore);
        }
        tcScore.text = cScore.ToString();
        tbScore.text = bScore.ToString();
    }