Ejemplo n.º 1
0
 private void PauseClick(object sender, MouseButtonEventArgs e)
 {
     BGMPlayer.Pause();
     workingResources.IsBGMPause = true;
     pause.Reset();
     ShowOverlayMessage("Pause");
 }
Ejemplo n.º 2
0
    void EditorDataUpdate()
    {
        if (Slected)
        {
            if (NoteChker[EditingData.line].Count - 1 >= EditingNoteIDonLine)
            {
                Editing = NoteChker[EditingData.line][EditingNoteIDonLine].gameObject;
            }
        }
        EditingisHold      = HoldInd;
        NoteIDonLine       = EditingNoteIDonLine;
        EditingDataDisplay = EditingData;
        NoteIDinStage      = EditingNoteIDinStage;


        if (DataChange)
        {
            NTDisplay.text = EditingData.Time.ToString();
            NTEdit.text    = NTDisplay.text;
            HTDisplay.text = "0.0";
            HTEdit.text    = HTDisplay.text;
            if (EditingisHold)
            {
                HTDisplay.text = "" + ((EditingData as Hold).EndTime - EditingData.Time).ToString();
                HTEdit.text    = HTDisplay.text;
            }
            DataChange = false;
        }

        if ((BGMPlayer.clip.length) / (StageTime) > 0 || (BGMPlayer.clip.length) / (StageTime) < 1)
        {
            if (!Pause)
            {
                TimeControl.value = (StageTime) / (BGMPlayer.clip.length);
            }
            else
            {
                StageTime = (BGMPlayer.clip.length * TimeControl.value);
            }
        }
        if (Input.GetAxis("Mouse ScrollWheel") > 0)
        {
            Pause = true;
            BGMPlayer.Pause();
            TimeControl.value += 0.001f;
        }
        else if (Input.GetAxis("Mouse ScrollWheel") < 0)
        {
            Pause = true;
            BGMPlayer.Pause();
            TimeControl.value -= 0.001f;
        }
    }
Ejemplo n.º 3
0
    public void Pause()
    {
        //Pause Time
        Time.timeScale = 0f;

        //Set UI
        pauseMenu.Pause();
        goal.SetActive(false);
        dieMenu.SetActive(false);

        //Set status
        pause = true;

        //Set movement
        move.SetActive(false);

        //Pause BGM
        BGMPlayer.Pause(0.6f);

        //FX
        postFX.Pause();
    }
Ejemplo n.º 4
0
    public void MoveTimewithKey(int i)
    {
        Pause = true;
        BGMPlayer.Pause();
        float BGMTime    = (StageTime - Stage.offset) / RealTime;
        float ChangeTime = new float();

        if (Mathf.Abs(BGMTime % 0.25f) <= 0.0001)
        {
            ChangeTime = ((BGMTime / 0.25f) + i) * 0.25f;
        }
        else
        {
            ChangeTime = ((int)(BGMTime / 0.25f) + i) * 0.25f;
        }
        StageTime         = ChangeTime * RealTime + Stage.offset;
        BGMPlayer.time    = StageTime;
        TimeControl.value = (StageTime) / (BGMPlayer.clip.length);
    }
Ejemplo n.º 5
0
 public void MoveTime(int k)
 {
     if (k == 0)
     {
         Pause = true;
         BGMPlayer.Pause();
         StageTime         = 0;
         BGMPlayer.time    = 0;
         TimeControl.value = (StageTime) / (BGMPlayer.clip.length);
     }
     else if (k == 1)
     {
         Pause = true;
         BGMPlayer.Pause();
         StageTime         = Stage.BGM.length;
         BGMPlayer.time    = StageTime;
         TimeControl.value = (StageTime) / (BGMPlayer.clip.length);
     }
 }
Ejemplo n.º 6
0
    // Update is called once per frame
    void FixedUpdate()
    {
        Player_FixedUpdate();
        if (Input.anyKeyDown)
        {
            Pause = true;
            BGMPlayer.Pause();
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Pause = false;
            if (StageTime < 0)
            {
                BGMPlayer.time = 0;
                BGMPlayer.PlayDelayed(0 - StageTime);
            }
            else if (StageTime >= Stage.BGM.length)
            {
            }
            else
            {
                BGMPlayer.time = StageTime;
                BGMPlayer.Play();
            }
        }
        DisPlayDataUpdate();

        EditorDataUpdate();

        if (Input.GetKeyDown(KeyCode.Delete))
        {
            Delete();
        }
        if (Input.GetKeyDown(KeyCode.UpArrow) && StageTime < Stage.BGM.length)
        {
            MoveTimewithKey(1);
        }
        else if (Input.GetKeyDown(KeyCode.DownArrow) && StageTime > 0)
        {
            MoveTimewithKey(-1);
        }
    }
Ejemplo n.º 7
0
 /// <summary>
 /// Pause BGM.
 /// </summary>
 /// <param name="fadeTime">Fade Out Time.</param>
 public void PauseBGM(float fadeTime = 0f)
 {
     bgmPlayer.Pause(fadeTime);
 }