The field 'foo' is assigned to but its value is never used
You have written to to a field, but the field was never accessed.
Either:
Finish writing your code, and read from the field.
_example.Method(); // Accessing the field by calling a method.
var value = _example.Value; // Accessing a member from the field.
var value = _example[0]; // Accessing an index from the field (if it was a collection).Or
Remove the field if you are not planning to use it.
-private Example _example = new Example();Or
If you are accessing the field via some other means—like reflection—you can mark it with the [UsedImplicitly] attribute.
[UsedImplicitly]
private Example _example = new Example();Also note that you may also need to use the [Preserve] attribute if you are building using AOT (IL2CPP for example).