Example #1
0
 //
 public IEnumerator CalculateExp(Stats contract)
 {
     _lootName.text = contract._name;
     _expBar.value = contract._exp;
     _givingExp = true;
     for(int e = 0; e < _expToGive; e++)
     {
         _expBar.value++;
         if(_expBar.value == 100)
         {
             contract.LevelUp();
             contract.ResetCurrentStats();
             _expBar.value = 0;
         }
         yield return new WaitForSeconds(.1f);
     }
     _givingExp = false;
 }