title: Best Approach to manage unity UI
body: <p>I'm developing games for almost 1 year but the code for UI elements is the most painful part of my game dev. Making UI is working is pretty easy although it's a lot of work to do it seems like I'm writing the same code again and again. Here is some code example that'll help you understand what I'm trying to convey to you</p>
  <pre><code>public Slider volume; //let suppose i have too many sliders
  public float volume_val;
  
  private Toggle soundToggler;// let suppose i have too many Toggle
  public bool isMuted;
  
  private Text coinText; // let suppose i have too many Text
  public float coins;
  
  // let suppose i have too many XYZ fields
  
  private void Awake ()
  {
  
    volume_val = PlayerPrefs.GetFloat (&quot;volume_val&quot;);
    volume.value = volume_val;
    volume.onValueChanged.AddListener ( (newVolume) =&gt; {
     volume_val = newVolume;
     PlayerPrefs.SetFloat (&quot;volume_val&quot;, volume_val);
    });
  
    isMuted = PlayerPrefs.GetInt (&quot;isMuted&quot;) == 1 ? true : false;
    soundToggler.isOn = isMuted;
    soundToggler.onValueChanged.AddListener ((newVal)=&gt; {
     isMuted = newVal;
     PlayerPrefs.SetInt (&quot;isMuted&quot;, isMuted ? 1 : 0);
    });
    
    coins = PlayerPrefs.GetFloat (&quot;coins&quot;);
    coinText.text = coins;
    // update text on value update
  }
  </code></pre>
  <p>As you can see by the code I'm repeating the same code, again and again, is there any generic way to do this?</p>