Skip to content
Snippets Groups Projects
Commit e494091b authored by Alexis Iakovenko's avatar Alexis Iakovenko
Browse files

Fix total score computing

parent b1ff966e
Branches
No related tags found
No related merge requests found
......@@ -22,6 +22,12 @@ public class LiveComparer : MonoBehaviour
Vector3 rightPalmPosition = Vector3.zero;
Vector3 rightPalmRotation = Vector3.zero;
public void ResetScore()
{
totalScore = 0.0f;
frameScore = 0.0f;
sumScore = 0.0f;
}
void Update ()
{
......@@ -33,12 +39,6 @@ public class LiveComparer : MonoBehaviour
ComputeScore ();
UpdateScoreLabels ();
}
else
{
totalScore = 0.0f;
frameScore = 0.0f;
sumScore = 0.0f;
}
}
void ComputeScore()
......@@ -61,7 +61,7 @@ public class LiveComparer : MonoBehaviour
frameScore -= absoluteDifferencePosition + absoluteDifferenceRotation;
sumScore += frameScore;
totalScore = sumScore / (replay.currentFrame + 1);
totalScore = sumScore / (replay.currentFrame);
}
void FetchPalmsCoordinates()
......
......@@ -445,6 +445,17 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- m_Target: {fileID: 1896376827}
m_MethodName: ResetScore
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!114 &512389763
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment