Hello,
I need to redefine certain attributes (initial variables) for the child class laserTower, which is extended ( a child of) the tower class;
Laser Tower Code:
public class laserTower : tower {
public int attack = 3;
public int variance = 0;
public float range = 2f;
public int attSpeed = 0;
}
Tower Code:
public class tower : MonoBehaviour {
public int attack = 15;
public int variance = 10;
public string type = "poison";
public float range = 1f;
public int attSpeed = 2;
public bool cooldown = false;
}
I am getting an error for reserializing all of the variables:
“The same field name is serialized multiple times in the class or it’s parent class. This is not supported: Base(laserTower) attSpeed”
It is not a fatal error, and it still works weirdly enough. But positive its not good practice.
How can I avoid these while still redefining my attributes