Hello Hugo, first… got to say, I really enjoy this course. My favorite GameDevTV course without a doubt.
Really opened my eyes for how to use events more efficently.
But… I am wondering, making the two static OnUnitSpawned / OnUnitDead events in the Unit script this episode, is it really necessary?
I mean, why not just use a simple linq query, is there benfits in efficiency with events over finding an object?
_unitList = new List<Unit>(FindObjectsOfType<Unit>());
_friendlyUnitList = _unitList.FindAll(u => !u.IsEnemy());
_enemyUnitList = _unitList.FindAll(u => u.IsEnemy());
This does more or less the same thing, if I am not mistaken?