mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ios] Improved test
This commit is contained in:
parent
cc43fd549b
commit
1627bd81e5
@ -19,6 +19,14 @@ let package = Package(
|
|||||||
.product(name: "SpineSwift", package: "spine-runtimes")
|
.product(name: "SpineSwift", package: "spine-runtimes")
|
||||||
],
|
],
|
||||||
path: "src"
|
path: "src"
|
||||||
|
),
|
||||||
|
.executableTarget(
|
||||||
|
name: "SimpleTest",
|
||||||
|
dependencies: [
|
||||||
|
.product(name: "SpineC", package: "spine-runtimes"),
|
||||||
|
.product(name: "SpineSwift", package: "spine-runtimes")
|
||||||
|
],
|
||||||
|
path: "simpletest"
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -11,4 +11,7 @@ runSkeletonDrawableTest()
|
|||||||
|
|
||||||
// Run the new SpineSwift API test
|
// Run the new SpineSwift API test
|
||||||
print("\n=== Testing SpineSwift API ===")
|
print("\n=== Testing SpineSwift API ===")
|
||||||
|
print("Starting SpineSwift test...")
|
||||||
|
print("About to call runSkeletonDrawableTestSwift...")
|
||||||
runSkeletonDrawableTestSwift()
|
runSkeletonDrawableTestSwift()
|
||||||
|
print("SpineSwift test completed")
|
||||||
@ -4,19 +4,25 @@ import SpineSwift
|
|||||||
func runSkeletonDrawableTestSwift() {
|
func runSkeletonDrawableTestSwift() {
|
||||||
print("Testing SkeletonDrawable with SpineSwift API...")
|
print("Testing SkeletonDrawable with SpineSwift API...")
|
||||||
|
|
||||||
|
print("Step 1: Enable debug extension")
|
||||||
// Enable debug extension if needed
|
// Enable debug extension if needed
|
||||||
enableDebugExtension(false)
|
enableDebugExtension(false)
|
||||||
|
print(" Debug extension configured")
|
||||||
|
|
||||||
|
print("Step 2: Load file paths")
|
||||||
// Load atlas and skeleton data
|
// Load atlas and skeleton data
|
||||||
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
|
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
|
||||||
let jsonPath = "../../spine-ts/assets/spineboy-pro.json"
|
let jsonPath = "../../spine-ts/assets/spineboy-pro.json"
|
||||||
|
|
||||||
|
print("Step 3: Read atlas file")
|
||||||
// Read atlas file
|
// Read atlas file
|
||||||
guard let atlasData = try? String(contentsOfFile: atlasPath, encoding: .utf8) else {
|
guard let atlasData = try? String(contentsOfFile: atlasPath, encoding: .utf8) else {
|
||||||
print("❌ Failed to read atlas file: \(atlasPath)")
|
print("❌ Failed to read atlas file: \(atlasPath)")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
print(" Atlas file read successfully")
|
||||||
|
|
||||||
|
print("Step 4: Load atlas with SpineSwift API")
|
||||||
// Load atlas
|
// Load atlas
|
||||||
let atlas: Atlas
|
let atlas: Atlas
|
||||||
do {
|
do {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user