コード例 #1
0
    void ScoreGem(FrogGameCueBug bug)
    {
        switch (bug.bugCueState)
        {
        case FrogGameCueBug.CueState.OK:
            gameScore += 1;
            Debug.Log("OK!");
            PlayFeedbackSound(hitClips[Random.Range(0, hitClips.Length)]);
            Destroy(bug.gameObject);
            break;

        case FrogGameCueBug.CueState.Good:
            gameScore += 2;
            Debug.Log("Good!");
            PlayFeedbackSound(hitClips[Random.Range(0, hitClips.Length)]);
            Destroy(bug.gameObject);
            break;

        case FrogGameCueBug.CueState.Perfect:
            gameScore += 3;
            Debug.Log("Perfect!");
            PlayFeedbackSound(hitClips[Random.Range(0, hitClips.Length)]);
            Destroy(bug.gameObject);
            break;

        case FrogGameCueBug.CueState.Late:
            Debug.Log("Missed!");
            PlayFeedbackSound(missedClips[Random.Range(0, missedClips.Length)]);
            break;
        }
    }
コード例 #2
0
    public void CreateCueUnityInput()
    {
        //Debug.Log("create cue");
        //determining which cue lane we're in (which cue type we're using)
        int cueLaneIndex = int.MaxValue;


        for (int i = 0; i < frogGameCues.Length; i++)
        {
            if (frogGameCues[i].playerInput == beatEvents[beatEventIndex].unityInput)
            {
                cueLaneIndex = i;
            }
        }


        if (cueLaneIndex == int.MaxValue)
        {
            Debug.LogWarning("beatmap input doesn't match current inputs!");
        }

        GameObject newCue = Instantiate(frogGameCues[cueLaneIndex].cuePrefab, frogGameCues[cueLaneIndex].cueStartLocation.transform.position, Quaternion.identity);


        FrogGameCueBug cueBug = newCue.GetComponent <FrogGameCueBug>();

        cueBug.bmEvent      = beatEvents[beatEventIndex];
        cueBug.nextLoopTime = Clock.Instance.AtNextSixteenth();

        //Set Window Timings
        cueBug.OkWindowStart      = cueBug.bmEvent.eventMBT.GetMilliseconds() - (0.5d * OkWindowMillis);
        cueBug.OkWindowEnd        = cueBug.bmEvent.eventMBT.GetMilliseconds() + (0.5d * OkWindowMillis);
        cueBug.GoodWindowStart    = cueBug.bmEvent.eventMBT.GetMilliseconds() - (0.5d * GoodWindowMillis);
        cueBug.GoodWindowEnd      = cueBug.bmEvent.eventMBT.GetMilliseconds() + (0.5d * GoodWindowMillis);
        cueBug.PerfectWindowStart = cueBug.bmEvent.eventMBT.GetMilliseconds() - (0.5d * PerfectWindowMillis);
        cueBug.PerfectWindowEnd   = cueBug.bmEvent.eventMBT.GetMilliseconds() + (0.5d * PerfectWindowMillis);
    }