void FixedUpdate()
    {
        if (isEnabled)
        {
            Skeleton userSkeleton = CurrentUserTracker.CurrentSkeleton;
            float    totalScore   = 0;

            if (userSkeleton != null)
            {
                Skeleton            techniqueSkeleton = TechniqueAvatar.CurSkeleton;
                ComparisonFrameData result            = Comparer.Compare(userSkeleton, techniqueSkeleton);

                UserAvatar.SetColor(result);
                totalScore = result.TotalScore;

                if (1 - totalScore < MIN_SCORE_THRESHOLD)
                {
                    Comparer.Curve = RelaxedCurveProvider.Curve;
                    CountdownTimer.SetRunning(true);
                }
                else
                {
                    Comparer.Curve = CurveProvider.Curve;
                    CountdownTimer.SetRunning(false);
                    CountdownTimer.Reset();
                    CountdownTimer.Text = "Into Position";
                }
            }

            ScoreBar.UpdateScore(totalScore);
        }
    }
예제 #2
0
    void FixedUpdate()
    {
        ComparisonFrameData comparison = comparer.Compare(UserAvatar.CurSkeleton, TechniqueAvatar.CurSkeleton);

        UserAvatar.SetColor(comparison);

        float totalScore = comparison.TotalScore;

        //float totalScore = Mathf.Sqrt(comparison.JointScores.Values.Min());
        FrameScoreBar.UpdateScore(totalScore);
    }