mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[dart] Check C++ class name, not C type name in RTTI based instantiation, as that's what RTTI gives us as className.
This commit is contained in:
parent
0e0a12b4a5
commit
244abfb65a
@ -1336,8 +1336,10 @@ ${declaration} {`;
|
||||
lines.push(`switch (className) {`);
|
||||
|
||||
for (const subclass of concreteSubclasses) {
|
||||
const cppClass = this.classMap.get(subclass);
|
||||
if (!cppClass) throw Error(`Class ${subclass} not found in class map`);
|
||||
const dartSubclass = this.toDartTypeName(subclass);
|
||||
lines.push(` case '${subclass}':`);
|
||||
lines.push(` case '${cppClass.cppType.name}':`);
|
||||
lines.push(` return ${dartSubclass}.fromPointer(${resultVar}.cast());`);
|
||||
}
|
||||
|
||||
|
||||
@ -91,6 +91,17 @@ void main() async {
|
||||
final boundsInJump = drawable.skeleton.bounds;
|
||||
print(' Bounds during jump: $boundsInJump');
|
||||
|
||||
// Test constraint RTTI
|
||||
print('\nTesting constraint RTTI:');
|
||||
|
||||
// IK Constraints
|
||||
print(' Constraints:');
|
||||
for (final constraint in drawable.skeleton.constraints) {
|
||||
final data = constraint?.data;
|
||||
print(' Constraint type: ${constraint?.rtti.className}');
|
||||
print(' Constraint data type: ${constraint?.data?.rtti.className}');
|
||||
}
|
||||
|
||||
// Check manager state before cleanup
|
||||
print('\nBefore cleanup:');
|
||||
AnimationStateEventManager.instance.debugPrint();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user