示例#1
0
    private void Start()
    {
        isPress       = 0;
        pressDown     = 0;
        pressUp       = 0;
        currentVolume = 0;

        source    = GetComponent <AudioSource>();
        maxVol    = source.volume;
        rec       = GetComponent <RectTransform>();
        volume[0] = () => { };
        volume[1] = () =>
        {
            pressUp = Input.mousePosition.x;
            float offset    = pressUp - pressDown;
            float delta     = 1.2f;
            float futurePos = rec.localPosition.x + offset * delta;
            if (futurePos >= min && futurePos <= max)
            {
                rec.localPosition += new Vector3(offset * delta, 0, 0);
            }
            pressDown = pressUp;
        };
        rec.localPosition = new Vector3(max, rec.localPosition.y, rec.localPosition.z);

        if (PlayerPrefs.HasKey("Volume"))
        {
            float vol = PlayerPrefs.GetFloat("Volume");
            TapToExit.SetupVolume(vol);
            Conecting.Volume = vol;

            float range       = max - min;
            float soundVolume = range * vol;
            rec.localPosition = new Vector3(min + soundVolume, rec.localPosition.y, rec.localPosition.z);
        }
        else
        {
            TapToExit.SetupVolume(1);
            PlayerPrefs.SetFloat("Volume", 1);
            Conecting.Volume = 1;
        }
        if (PlayerPrefs.HasKey("Music"))
        {
            Conecting.Music = PlayerPrefs.GetInt("Music");
            StartCoroutine(CheckBoxMusic.box[Conecting.Music]());
            if (PlayerPrefs.GetInt("Music") == 1)
            {
                check.SetActive(true);
                line.SetActive(true);
            }
            // Так должно быть(без else)
        }
        else
        {
            Conecting.Music = 1;
            check.SetActive(true);
            line.SetActive(true);
            PlayerPrefs.SetInt("Music", 1);
        }
    }
示例#2
0
 public void GoToNewScene()
 {
     frame.SetActive(true);
     TapToExit.SetDefaultValue();
     TapToSettings.SetDefaultValue();
     LoadToPlayingScene.progress(number);
 }
示例#3
0
 private void OnMouseDown()
 {
     TapToExit.PlayClip();
     Conecting.Language            = 1 - Conecting.Language;
     GetComponent <Image>().sprite = lang[Conecting.Language];
     PlayerPrefs.SetInt("Language", Conecting.Language);
     SetLanguage();
 }
示例#4
0
 private void OnMouseDown()
 {
     TapToExit.PlayClip();
     check.SetActive(true);
     line.SetActive(true);  // Так должно быть
     Conecting.Music = 1 - Conecting.Music;
     PlayerPrefs.SetInt("Music", Conecting.Music);
     StartCoroutine(box[Conecting.Music]());
 }
示例#5
0
 IEnumerator ActivateVol()
 {
     while (!TapToExit.IsInicialised || !TapToSettings.IsInicialised)
     {
         yield return(null);
     }
     MessageSystemMainScreen.ActivateVolume();
     TapToSettings.ActivateVolume();
     TapToExit.ActivateVolume();
 }
示例#6
0
 private void OnMouseUp()
 {
     currentVolume    = (rec.transform.localPosition.x - min) / (max - min);
     Conecting.Volume = currentVolume;
     TapToExit.SetupVolume(currentVolume);
     TapToSettings.SetupVolume(currentVolume);
     MessageSystemMainScreen.SetupVolume(currentVolume);
     PlayerPrefs.SetFloat("Volume", currentVolume);
     PlayClip();
     isPress = 0;
 }
示例#7
0
    IEnumerator DisactiveVol()
    {
        while (!TapToExit.IsInicialised || !TapToSettings.IsInicialised)
        {
            yield return(null);
        }

        MessageSystemMainScreen.DisactiveVolume();
        TapToExit.DisactiveVolume();
        TapToSettings.DisactiveVolume();
        check.SetActive(false);
        line.SetActive(false);
    }
示例#8
0
 private void OnMouseDown()
 {
     TapToExit.PlayClip();
     if (name == "Swipe")
     {
         Conecting.Management = 0;
     }
     else
     {
         Conecting.Management = 1;
     }
     GetComponent <Image>().sprite = press[Conecting.Management];
     if (PlayerPrefs.HasKey("Management"))
     {
         buttons[Conecting.Management].GetComponent <Image>().sprite = defaultSprite;
     }
     PlayerPrefs.SetInt("Management", Conecting.Management);
 }
示例#9
0
 private void OnMouseDown()
 {
     TapToExit.PlayClip();
     transform.localScale = new Vector3(newSize, newSize, 1);
 }
示例#10
0
文件: No.cs 项目: nexartic/Portfolio
 private void OnMouseUp()
 {
     transform.localScale = new Vector3(1, 1, 1);
     MessageSystemMainScreen.CloseExitPanel();
     TapToExit.PlayClip();
 }
示例#11
0
 private void OnMouseDown()
 {
     TapToExit.PlayClip();
     transform.localScale = new Vector3(changeScale, changeScale, changeScale);
 }
示例#12
0
 private void OnMouseUp()
 {
     TapToExit.PlayClip();
     transform.localScale = new Vector3(1, 1, 1);
     Application.Quit();
 }