Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - voncarp

Pages: 1 ... 5 6 [7]
91
Other Packages / Re: NGUI: HUD Text
« on: February 24, 2013, 11:09:10 AM »
That did it.  Thank you.

92
Other Packages / Re: NGUI: HUD Text
« on: February 24, 2013, 10:39:25 AM »
The following shows cumulative damage similar to the OnClick() version in ExampleTwo of the package.

  1.         void OnClick ()
  2.         {
  3.                 if (mText != null)
  4.                 {
  5.                         if (UICamera.currentTouchID == -1) mText.Add(-10f + Random.value * -10f, Color.red, 0f);
  6.                         else if (UICamera.currentTouchID == -2) mText.Add(10f + Random.value * 10f, Color.green, 0f);
  7.                 }
  8.         }

By modifying the above code to the following it doesn't show cumulative damage, but each damage individually.

  1.         public void DisplayDamage ()
  2.         {
  3.                 if (mText != null)
  4.                 {
  5.                        
  6.                         totalDamage = totalDamage + damageRecieved;
  7.                         mText.Add("-" + totalDamage , Color.red, 0f);
  8.                        
  9.                 }
  10.         }

What would you suggest to get all the damage to add up as in the example?

Pages: 1 ... 5 6 [7]