static void Main(string[] args) { PlayerClass pc = new PlayerClass() { Health = 100, Armour = 100 }; PlayerStruct ps = new PlayerStruct() { Health = 100, Armour = 100 }; KillPlayerClass(pc); KillPlayerStruct(ps); Console.WriteLine($"Class : {pc.Health}"); Console.WriteLine($"Struct: {ps.Health}"); }
static void KillPlayerStruct(PlayerStruct ps) { ps.Health = 0; }