public void AddExperience(float exp) { currentExp += exp; if (currentExp >= expToLevel) { currentExp -= expToLevel; LevelUp(); } // Update exp bar gui.SetPlayerExp(currentExp / expToLevel, level); // Update enemies killed (only if an enemy was killed) if (exp > 0) { enemiesKilled++; } }