コード例 #1
0
    private void DoScore()
    {
        for (int i = 0; i < birds.Length; i++)
        {
            if (!birds[i].IsInitialized())
            {
                continue;
            }

            PoseData currentPose = Pose.CalculateFromController(birds[i].GetInput());
            PoseData prevPose    = lastPose[i];

            //compare
            PoseDiff poseDiff = Pose.CalculatePoseDiffs(currentPose, prevPose);

            int randomScoreModifier = Random.Range(5, 10);
            int amount = Mathf.FloorToInt(poseDiff.totalDiff) * randomScoreModifier;
            ScoreHandler.GetInstance().AddScore(i, amount);

            lastPose[i] = currentPose;
        }
        ScoreChanged();
    }
コード例 #2
0
    //To be called from BeatGUIBar
    public void HitFullBeat(Pose data)
    {
        for (int i = 0; i < birds.Length; i++)
        {
            if (!birds[i].IsInitialized())
            {
                continue;
            }

            ControllerInput input       = birds[i].GetInput();
            PoseData        currentPose = Pose.CalculateFromController(input);

            //compare
            PoseDiff poseDiff = data.CompareWithController(input, 0);
            float    diff     = poseDiff.totalDiff;


            //Log.Weikie("pose difference:" + diff);
            PlayerScoreFeedback(diff, i);

            lastPose[i] = currentPose;
        }
        ScoreChanged();
    }