diff --git a/spine-flutter/example/lib/flame_example.dart b/spine-flutter/example/lib/flame_example.dart index 6fb007237..76bf0b726 100644 --- a/spine-flutter/example/lib/flame_example.dart +++ b/spine-flutter/example/lib/flame_example.dart @@ -125,7 +125,7 @@ class SimpleFlameExample extends FlameGame { ); // Set the "walk" animation on track 0 in looping mode - spineboy.animationState.setAnimationByName(0, "walk", true); + spineboy.animationState.setAnimation(0, "walk", true); await add(spineboy); } @@ -150,10 +150,10 @@ class DragonExample extends FlameGame { drawable, scale: Vector2(0.4, 0.4), anchor: Anchor.center, - position: Vector2(size.x / 2, size.y / 2 - 150), + position: Vector2(size.x / 2, size.y / 2), ); // Set the "walk" animation on track 0 in looping mode - dragon.animationState.setAnimationByName(0, "flying", true); + dragon.animationState.setAnimation(0, "flying", true); await add(dragon); } @@ -186,7 +186,7 @@ class PreloadAndShareSpineDataExample extends FlameGame { final scale = 0.1 + rng.nextDouble() * 0.2; final position = Vector2(rng.nextDouble() * size.x, rng.nextDouble() * size.y); final spineboy = SpineComponent(drawable, scale: Vector2(scale, scale), position: position); - spineboy.animationState.setAnimationByName(0, "walk", true); + spineboy.animationState.setAnimation(0, "walk", true); spineboys.add(spineboy); await add(spineboy); } diff --git a/spine-flutter/example/macos/Runner/AppDelegate.swift b/spine-flutter/example/macos/Runner/AppDelegate.swift index 33b0f3edd..f8fd66258 100644 --- a/spine-flutter/example/macos/Runner/AppDelegate.swift +++ b/spine-flutter/example/macos/Runner/AppDelegate.swift @@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/spine-flutter/lib/spine_dart.dart b/spine-flutter/lib/spine_dart.dart index 506e57dc7..f026a1be4 100644 --- a/spine-flutter/lib/spine_dart.dart +++ b/spine-flutter/lib/spine_dart.dart @@ -262,7 +262,7 @@ class AnimationStateEventManager { listeners.remove(entryKey); } else { listeners[entryKey] = listener; - print('DEBUG: Registered listener for TrackEntry at address: $entryKey for AnimationState at address: $stateKey'); + // print('DEBUG: Registered listener for TrackEntry at address: $entryKey for AnimationState at address: $stateKey'); } } @@ -271,9 +271,9 @@ class AnimationStateEventManager { final entryKey = entry.nativePtr.address; final listener = _trackEntryListeners[stateKey]?[entryKey]; if (listener == null) { - print('DEBUG: No listener found for TrackEntry at address: $entryKey in AnimationState at address: $stateKey'); - print('DEBUG: Available state keys: ${_trackEntryListeners.keys.toList()}'); - print('DEBUG: Available entry keys for state $stateKey: ${_trackEntryListeners[stateKey]?.keys.toList()}'); + // print('DEBUG: No listener found for TrackEntry at address: $entryKey in AnimationState at address: $stateKey'); + // print('DEBUG: Available state keys: ${_trackEntryListeners.keys.toList()}'); + // print('DEBUG: Available entry keys for state $stateKey: ${_trackEntryListeners[stateKey]?.keys.toList()}'); } return listener; }