Skip to main content
Cleanup
Source Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401

Hi guys, I am new Updating settings UI from script also triggers method to unity. I am facing a problem regarding developing ui in unityupdate settings from UI interaction

My application has a UI for settings which is a mixture of textboxes and scrollbars with which users can interact. I have created a class for thisthese settings and create aan object to store them. UserThe user can also give command line arguments to apply settingsettings from a file as well. 

I have a function that loads this data into the UI from the object  (i.e read from a file) and have another function that changes object data when user make changes to the UI. So here is where the

My problem is: if I load the data from file into UI, the function responsible to makereflect these changes in the UI fires up but the other function also fires up because changes were made to the UI. 

So what should I do to overcome this? shouldShould I implement some kind of state mechanism that would tell code that user has made the changes., or setup some flag which will tellmark that the data is loaded from a file. If you can suggest some design patterns to follow?

Hi guys, I am new to unity. I am facing a problem regarding developing ui in unity

My application has a UI for settings which is a mixture of textboxes and scrollbars with which users can interact. I have created a class for this settings and create a object to store them. User can also give command line arguments to apply setting from file as well. I have a function that loads this data into the UI from object(i.e read from a file) and have another function that changes object data when user make changes to UI. So here is where the problem is: if I load the data from file into UI, the function responsible to make changes in UI fires up but the other function also fires up because changes were made to UI. So what should I do to overcome this? should I implement some kind of state mechanism that would tell code that user has made the changes. or setup some flag which will tell that the data is loaded from a file. If you can suggest some design patterns to follow?

Updating settings UI from script also triggers method to update settings from UI interaction

My application has a UI for settings which is a mixture of textboxes and scrollbars with which users can interact. I have created a class for these settings and create an object to store them. The user can also give command line arguments to apply settings from a file. 

I have a function that loads this data into the UI from the object  (i.e read from a file) and another function that changes object data when user make changes to the UI.

My problem is: if I load the data from file into UI, the function responsible to reflect these changes in the UI fires up but the other function also fires up because changes were made to the UI. 

So what should I do to overcome this? Should I implement some kind of state mechanism that would tell code that user has made the changes, or setup some flag which will mark that the data is loaded from a file. If you can suggest some design patterns to follow?

Source Link

Hi guys, I am new to unity. I am facing a problem regarding developing ui in unity

My application has a UI for settings which is a mixture of textboxes and scrollbars with which users can interact. I have created a class for this settings and create a object to store them. User can also give command line arguments to apply setting from file as well. I have a function that loads this data into the UI from object(i.e read from a file) and have another function that changes object data when user make changes to UI. So here is where the problem is: if I load the data from file into UI, the function responsible to make changes in UI fires up but the other function also fires up because changes were made to UI. So what should I do to overcome this? should I implement some kind of state mechanism that would tell code that user has made the changes. or setup some flag which will tell that the data is loaded from a file. If you can suggest some design patterns to follow?