For example, if I have enemies, and each of the enemies has a class that keeps the points. Then I when an enemy is spawned in, it connects to PointsKeeper.Instance
and adds itself to List<EnemyPoints> points
Is there an easy way of knowing if the EnemyPoints
that I add do the list, is a reference to the original or a copy?
Example code:
private List<EnemyPoints> points;
public void AddEnemy(EnemyPoints enemy)
{
points.Add(enemy);
}
public void AddPoint(int enemy)
{
points[enemy].points++;
}