Example #1
0
 void OnEnable()
 {
     text.text = placeholder;
     variable  = CFG.GetVar(varName);
     if (variable == null)
     {
         StartCoroutine(getvar());
     }
     else
     {
         variable.OnChangedBase += Sync;
     }
 }
Example #2
0
 IEnumerator getvar()
 {
     while (true)
     {
         variable = CFG.GetVar(varName);
         if (variable != null)
         {
             break;
         }
         yield return(null);
     }
     variable.OnChangedBase += Sync;
     yield break;
 }
 // Use this for initialization
 void Start()
 {
     _slider  = GetComponent <Slider>();
     variable = CFG.GetVar(varName);
     floatvar = (CFG.Variable <float>)variable;
 }