You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to make two C# classes: S1 and S2, and make S2 inherits S1.
S1 has an export variable S1_Int, and S2 has an export variable S2_Int (and also S1_Int that is inherited from S1).
If I add the [Tool] attribute to S1 and S2, an issue arise, when I try to change the value of the export variable S1_Int in S2 (that was inherited from S1) and then compile the C# code, the value of S1_Int resets to the default value.
Example with pictures:
The scene Level.tscn contains S1 and S2:
1)At first, S1_Int and S2_Int have their default values (in the example 5 and 20):
2)Change S1_Int to 6, and S2_Int to 21:
3)Make "Some change" in a cs file to force a recompile:
4)Run the project, and notice that S1_Int resets while S2_Int stays with the same value:
For some reason, this issue only happens if the scene that contains S1 and S2 is opened, if it's not the value won't reset.
Also, if after the change I close and open Level.tscn again, S1_Int will contain the right value.
Moreover, if I print the values using GD-Print, in the first run the right value will be printed, however in the second run the default value will be printed.
Steps to reproduce
1)Create 2d Project using C# with the mono version.
2)Create 2 scenes, S1 and S2 where S2 inherits S1.
3)Add a protected export variable to S1, and compile the project (in order to view the variable in S2).
4)Change the default value of this variable.
5)Make a small change in the C# code (to force a recompile), and run the project.
6)The value of the inherited variable will reset.
I suppose I can confirm that on linux version of 3.3.3. mono x64(kinda, my bug looks like alot like this but is simpler in a way):
After closing and reopening of the project all of the overrided exported variables are "reverted" to default values in the start scene. But closing the scene and opening it again and all the overrided values are intact.
Godot version
Godot_v3.3.3-stable_mono_win64
System information
Windows 10
Issue description
I want to make two C# classes: S1 and S2, and make S2 inherits S1.
S1 has an export variable S1_Int, and S2 has an export variable S2_Int (and also S1_Int that is inherited from S1).
If I add the [Tool] attribute to S1 and S2, an issue arise, when I try to change the value of the export variable S1_Int in S2 (that was inherited from S1) and then compile the C# code, the value of S1_Int resets to the default value.
Example with pictures:
The scene Level.tscn contains S1 and S2:
1)At first, S1_Int and S2_Int have their default values (in the example 5 and 20):
2)Change S1_Int to 6, and S2_Int to 21:
3)Make "Some change" in a cs file to force a recompile:
4)Run the project, and notice that S1_Int resets while S2_Int stays with the same value:
For some reason, this issue only happens if the scene that contains S1 and S2 is opened, if it's not the value won't reset.
Also, if after the change I close and open Level.tscn again, S1_Int will contain the right value.
Moreover, if I print the values using GD-Print, in the first run the right value will be printed, however in the second run the default value will be printed.
Steps to reproduce
1)Create 2d Project using C# with the mono version.
2)Create 2 scenes, S1 and S2 where S2 inherits S1.
3)Add a protected export variable to S1, and compile the project (in order to view the variable in S2).
4)Change the default value of this variable.
5)Make a small change in the C# code (to force a recompile), and run the project.
6)The value of the inherited variable will reset.
Minimal reproduction project
ToolBugTest.zip
The text was updated successfully, but these errors were encountered: