Author Topic: Use of Update() to track a party's info.  (Read 3786 times)

Majicpanda

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 83
    • View Profile
Use of Update() to track a party's info.
« on: April 19, 2014, 12:28:10 AM »
I'm wondering what the performance issues are if you use Update() on a class that you define say a public Party myParty which is simply a List<T> of members in your party.

Update would be updating the healthbar slider to always be up to date opposed to the current model I have of directly informing the party UI any time health is changed.  I tried using an event delegate system and wasn't happy with it, but it seems like there's some performance hits by updating widgets in Update like this.  Can you confirm that?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Use of Update() to track a party's info.
« Reply #1 on: April 19, 2014, 06:00:39 PM »
There is a small performance hit of having a script with the Update() function in it, but it's nothing you will notice. The convenience of it far outweighs the downside.