PropaneDragon / RushHour

Citizens act like real people when deciding what to do based on the time of day. No more school at 3 am!
33 stars 19 forks source link

Please fix OnSettingsUI #27

Closed SamsamTS closed 8 years ago

SamsamTS commented 8 years ago

Hi there PropaneDragon,

Can you please change UIButton componentInChildren = Resources.FindObjectsOfTypeAll<OptionsKeymappingPanel>()[0].GetComponentInChildren<UITabstrip>().GetComponentInChildren<UIButton>();

to

UIButton componentInChildren = GameObject.Find("KeyMappingTabStrip").GetComponentInChildren<UIButton>();

It is not safe. I cannot use OptionsKeymappingPanel because of this.

PropaneDragon commented 8 years ago

Sorry about that. I'm away for a week unfortunately, but I'll fix it as soon as I get back. Thanks for the fix.

SamsamTS commented 8 years ago

I end up copying the decompiled version of OptionsKeymappingPanel instead of inherit from it so it's all good now. I still wouldn't recommend the use of Resources.FindObjectsOfTypeAll because there is no guaranty that the first element is the one you want.

You can close this issue if you want.

PropaneDragon commented 8 years ago

This should be fixed now.