using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class enemy : MonoBehaviour
{
[System.Serializable]
public class EnemyStats {
public int maxHealth = 100;
private int _curHealth;
public int curHealth {
get { return _curHealth; }
set { _curHealth = Mathf.Clamp (value, 0, maxHealth); }
}
if (statusIndicator != null) {
statusIndicator.SetHealth(stats.curHealth, stats.maxHealth);
}
public void DamageEnemy (int damage) { (it says it’s here but I don’t know what is wrong)
stats.curHealth -=damage;
if (stats.curHealth <= 0) {
GameMaster.KillEnemy (this);
}
}
if (statusIndicator != null) {
statusIndicator.SetHealth(stats.curHealth, stats.maxHealth);
}
}
}
While it’s certainly good practice to start with a capital letter on the class name, there is nothing actually preventing a person from having their class name be lowercase, as long as the class and script name are the same. (Though I personally find it annoying when it’s all lowercase. lol)
While true it’s better, it’s not a requirement. And trust me, I’ve dealt with my share of “programmers” who didn’t follow conventions. Luckily, none of them work on my team anymore at work. lol.