示例#1
0
    void SoundLevel()
    {
        GameObject   Hat = GameObject.Find("HatsEnd");        //Get SoundLevel info. from Hats Score Manager
        ScoreManager SM  = Hat.GetComponent <ScoreManager>(); //Link to ScoreManager Script which handles detection of Hats hits

        HatsPlayer.volume = SM.HatsSoundLevel;

        GameObject    Snare = GameObject.Find("EndPos");            //Get SoundLevel info. from Hats Score Manager
        ScoreManSnare SMS   = Snare.GetComponent <ScoreManSnare>(); //Link to ScoreManSnare Script which handles detection of Snare hits

        SnarePlayer.volume = SMS.SnareSoundLevel;                   //Access the variable that stores sound level info. and apply it to the corresponding player

        GameObject Kick = GameObject.Find("KickEnd");               //Get SoundLevel info. from Hats Score Manager
        KickScore  KS   = Kick.GetComponent <KickScore>();          //Link to KickScore Script which handles detection of Kick hits

        KickPlayer.volume = KS.KickSoundLevel;                      //Access the variable that stores sound level info. and apply it to the corresponding player
    }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        GameObject    Hat        = GameObject.Find("HatsEnd");      //Script Name ScoreManager , Variable name HatsScore
        GameObject    Snare      = GameObject.Find("EndPos");       //Script Name ScoreManSnare , Variable name SnareScore
        GameObject    Kick       = GameObject.Find("Bass");         //Script Name KickScore, Variable name KickScore
        GameObject    Cymbal     = GameObject.Find("CymbalDetect"); //Script Name CymbalScore
        ScoreManager  HatsScore  = Hat.GetComponent <ScoreManager>();
        ScoreManSnare SnareScore = Snare.GetComponent <ScoreManSnare>();
        KickScore     KScore2    = Kick.GetComponent <KickScore>();
        CymbalScore   CScore     = Cymbal.GetComponent <CymbalScore>();

        CurrentScore = SnareScore.SnareScore + HatsScore.HatsScore + KScore2.KScore + CScore.CrashScore;
        MissedScore  = SnareScore.Snaremissed + HatsScore.HatsMissed + KScore2.KickMissed + CScore.CrashMissed;
        if (MissedScore > HighestMissed)
        {
            HighestMissed = MissedScore;
        }
        Combo();
        MissedScoreOld  = MissedScore;
        CurrentScoreOld = CurrentScore;
        //Debug.Log(CurrentScore);
    }