Describe the bug
If the dialogue manager accesses an C# object, it can not access the object's inherited property.
Affected version
- Dialogue Manager version: v3.10.4
- Godot version: 4.6.3
To Reproduce
Details can be seen in my reproduce repo https://github.com/ericeric284/GDDialogueProeprtyTest
Steps to reproduce the behavior:
- Create the following classes
//ReproBaseNode.cs
using Godot;
public partial class ReproBaseNode : Node
{
public string InheritedField = "Inherited value from base";
}
//ReproChildNode.cs
using Godot;
public partial class ReproChildNode : ReproBaseNode
{
public string ChildField = "Child value";
}
- Create a global autoload service MyGlobal, that creates a ReproChildNode as its child node, with method GetReproChildNode() to access it.
- Create a dilaogue with line
{{MyGlobal.GetReproChildNode().InheritedField}}, this will show < null > instead of Inherited value from base
Expected behavior
{{MyGlobal.GetReproChildNode().InheritedField}} should show Inherited value from base
however it will show < null >
Possible workaround
This workaround may solve the problem, but I didn't do a lot of test with this solution.
Edit DialogueManager.cs,
For ThingHasConstant() and ResolveThingConstant(), remove "| BindingFlags.DeclaredOnly".
Describe the bug
If the dialogue manager accesses an C# object, it can not access the object's inherited property.
Affected version
To Reproduce
Details can be seen in my reproduce repo https://github.com/ericeric284/GDDialogueProeprtyTest
Steps to reproduce the behavior:
{{MyGlobal.GetReproChildNode().InheritedField}}, this will show< null >instead ofInherited value from baseExpected behavior
{{MyGlobal.GetReproChildNode().InheritedField}}should showInherited value from basehowever it will show
< null >Possible workaround
This workaround may solve the problem, but I didn't do a lot of test with this solution.
Edit DialogueManager.cs,
For ThingHasConstant() and ResolveThingConstant(), remove "| BindingFlags.DeclaredOnly".