Ejemplo n.º 1
0
 public void Start()
 {
     _data.Initialize(1);
     ProgressChanged.SafeRaise(this, _data);
     _isRun         = true;
     _currCoroutine = _coroutine.StartCoroutine(Progress());
 }
Ejemplo n.º 2
0
 IEnumerator Progress()
 {
     while (_isRun)
     {
         var max     = Mathf.Max(2, UnityEngine.Random.value * MAX_TIME);
         var current = max;
         while (current >= 0)
         {
             _data.Initialize(current / max);
             ProgressChanged.SafeRaise(this, _data);
             current -= Time.deltaTime;
             yield return(null);
         }
         ProgressDone.SafeRaise(this, EventArgs.Empty);
         yield return(null);
     }
 }