Author Topic: Changing UI UILocalize key is not updating the value  (Read 3938 times)

kittikun

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 5
  • Posts: 46
    • View Profile
Changing UI UILocalize key is not updating the value
« on: June 17, 2014, 03:31:01 AM »
Hi,

I am trying to dynamically changed the UILocalize key after it has already been created but UILocalize doesn't pickup the change. If I disable and renable the object, it will work fine.

I can use Localization.Get but that would defeat the purpose of having a UILocalize on my labels

Another alternative i'd like to avoid would be to call SendMessage("OnLocalize") on my UILocalize component

Why not having key beeing a property that would call OnLocalize upon a set ?

Thank you
« Last Edit: June 17, 2014, 03:42:44 AM by kittikun »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Changing UI UILocalize key is not updating the value
« Reply #1 on: June 17, 2014, 01:44:43 PM »
UILocalize was designed with minimal performance impact in mind -- so it performs its task once, and it's done. What you're doing is changing its key -- which is just a public variable. It's not a property. It's up to you to call uiLocalize.value = Localization.Get(uiLocalize.key) after changing the key.