How to Avoid a public variable to get overwritten by the Inspector?
ADDITIONAL INFO:
I have public variable like so:
public class Bullet{
//it is default 0 in the Inspector
public float Damage;
I do not want to write in
OnEnable(){
Damage=10;
}
}
I have a Manager Object which does:
//Called only rarely and not per each time I enable the bullet
For each Bullet object b,
b.SetActive(true);
b.Damage=100;
But I keep getting 0 and not 100;
Please Help!
I tried:
[System.NonSerialized]
public float Damage;
but didn’t work.