Exemplo n.º 1
0
    internal void startSound(int number, TokenSpawner.Colours colour)
    {
        //Debug.Log("START SOUND!!");

        BasicClick.Stop();

        int newIndex = getIndexFromColour(colour);

        if (number == 0)
        {
            //Debug.LogFormat("drums: section:{0}, Genre:{1}", newIndex, number);

            Drums[IndexOne].Stop();
            Drums[newIndex].time = (float)(AudioSettings.dspTime - Metronome.SectionStartTime);

            Drums[newIndex].Play();

            SoundOnePlay = true;
            IndexOne     = newIndex;
        }

        else
        {
            //Debug.LogFormat("melody: {0}, {1}", newIndex, number);

            Melody[IndexTwo].Stop();
            Melody[newIndex].time = (float)(AudioSettings.dspTime - Metronome.SectionStartTime);

            Melody[newIndex].Play();
            SoundTwoPlay = true;
            IndexTwo     = newIndex;
        }
    }
Exemplo n.º 2
0
    int getIndexFromColour(TokenSpawner.Colours type)
    {
        switch (type)
        {
        case TokenSpawner.Colours.RED:
            return(0);

            break;

        case TokenSpawner.Colours.GREEN:
            return(1);

            break;

        case TokenSpawner.Colours.YELLOW:
            return(2);

            break;

        case TokenSpawner.Colours.BLUE:
            return(3);

            break;

        default:
            return(-1);

            break;
        }
    }
Exemplo n.º 3
0
        void SetColours(TokenSpawner.Colours tokenColour)
        {
            switch (tokenColour)
            {
            case TokenSpawner.Colours.RED:
                ColourChange.color = Color.red;
                break;

            case TokenSpawner.Colours.GREEN:
                ColourChange.color = Color.green;
                break;

            case TokenSpawner.Colours.YELLOW:
                ColourChange.color = Color.yellow;
                break;

            case TokenSpawner.Colours.BLUE:
                ColourChange.color = Color.blue;
                break;

            default:
                SelectedColour = ButtonDisplayIcon.colors;
                break;
            }
        }
Exemplo n.º 4
0
 // TODO:: implement this properrly for different Vehicles. (ie 'string vehicle' is just a placeholder for the time being)
 public static void HitTokenUpdate(string vehicle, int token, TokenSpawner.Colours tokenColour)
 {
     if (VehicleManager.IsPlayerById(vehicle))
     {
         Instance._trackEnabler[token].TokenHit(tokenColour);
     }
     else
     {
         Instance._vehicleDictionary[vehicle][token].TokenHit(tokenColour);
     }
 }
Exemplo n.º 5
0
        public void TokenHit(TokenSpawner.Colours tokenColour)
        {
            if (Counter < 0 || tokenColour != CurrColour)
            {
                Counter = 20;
            }
            else
            {
                Counter += 5;
            }

            CurrColour = tokenColour;

            if (CountSlider != null)
            {
                CountSlider.maxValue = Counter;
                CountSlider.value    = Counter;

                SetColours(tokenColour);

                SoundControl.CurrentMusicSection.startSound(ButtonNum, tokenColour);
            }
        }
Exemplo n.º 6
0
 public void setColour(TokenSpawner.Colours tokenCol)
 {
     _tokenColour = tokenCol;
 }