private void UpdateHappy() { if (happyTimer > 0f) { if (previousEmotion == MobEmotion.None) { previousEmotion = emotion; } emotion = MobEmotion.Happy; happyTimer -= Time.deltaTime; if (happyTimer <= 0f && previousEmotion != MobEmotion.None) { emotion = previousEmotion; previousEmotion = MobEmotion.None; } } }
private void UpdateRecoveryTimer() { if (previousEmotion == MobEmotion.None) { previousEmotion = emotion; } emotion = MobEmotion.Shocked; stunRecoveryTimer += Time.deltaTime; if (stunRecoveryTimer > Globals.mobRecoveryTime) { recovering = false; stunRecoveryTimer = 0f; if (previousEmotion != MobEmotion.None) { emotion = previousEmotion; previousEmotion = MobEmotion.None; } } }