The following shows cumulative damage similar to the OnClick() version in ExampleTwo of the package.
void OnClick ()
{
if (mText != null)
{
if (UICamera.currentTouchID == -1) mText.Add(-10f + Random.value * -10f, Color.red, 0f);
else if (UICamera.currentTouchID == -2) mText.Add(10f + Random.value * 10f, Color.green, 0f);
}
}
By modifying the above code to the following it doesn't show cumulative damage, but each damage individually.
public void DisplayDamage ()
{
if (mText != null)
{
totalDamage = totalDamage + damageRecieved;
mText.Add("-" + totalDamage , Color.red, 0f);
}
}
What would you suggest to get all the damage to add up as in the example?