Exemple #1
0
    /// <summary>
    /// Called when a music group unmutes the incorrect track, after it previously had unmuted the correct one
    /// </summary>
    void IncorrectTrack()
    {
        //decrement correct track
        numCorrectTracks--;

        //tell the tree to stop dancing
        tree.StopDancing();

        //If there are no longer 3 correct tracks
        if (numCorrectTracks != 3)
        {
            //Deactivate all sliders
            drumTablet.DeactivateSlider();
            pianoTablet.DeactivateSlider();
            guitarTablet.DeactivateSlider();

            matState = MatState.Decreasing;
        }
    }
Exemple #2
0
    /// <summary>
    /// Called when a music group unmutes the correct track
    /// </summary>
    void CorrectTrack()
    {
        //increment correct track
        numCorrectTracks++;

        //tell tree to start dancing
        tree.StartDancing();

        //If there are now 3 correct tracks
        if (numCorrectTracks == 3)
        {
            //Activate all sliders
            drumTablet.ActivateSlider();
            pianoTablet.ActivateSlider();
            guitarTablet.ActivateSlider();

            matState = MatState.Increasing;
        }
    }
Exemple #3
0
    void Update()
    {
        if (volState != VolState.None)
        {
            volume += Time.deltaTime * volumeRate;

            for (int x = 0; x < volumeLevels.Length; x++)
            {
                string paramName = volumeLevels[x];

                if (x == volumeFocus)
                {
                    if (volState == VolState.Increasing)
                    {
                        mixer.SetFloat(paramName, 0 + volume);
                    }
                    else if (volState == VolState.Decreasing)
                    {
                        mixer.SetFloat(paramName, volumeMax - volume);
                    }
                }

                else if (x != volumeFocus)
                {
                    if (volState == VolState.Increasing)
                    {
                        mixer.SetFloat(paramName, 0 - volume);
                    }

                    else if (volState == VolState.Decreasing)
                    {
                        mixer.SetFloat(paramName, (volumeMax * -1) + volume);
                    }
                }
            }

            if (volume >= volumeMax)
            {
                volume = 0;

                if (volState == VolState.Decreasing)
                {
                    volumeFocus = -1;
                }

                volState = VolState.None;
            }
        }


        if (matState == MatState.Increasing)
        {
            float val = glowMat.GetFloat("_node_3398");
            if (val < MAT_MAX)
            {
                val += Time.deltaTime * MAT_RATE;
                glowMat.SetFloat("_node_3398", val);
            }
            else
            {
                matState = MatState.None;
            }
        }
        else if (matState == MatState.Decreasing)
        {
            float val = glowMat.GetFloat("_node_3398");
            if (val > 0)
            {
                val -= Time.deltaTime * MAT_RATE;
                glowMat.SetFloat("_node_3398", val);
            }
            else
            {
                matState = MatState.None;
            }
        }
    }