回答編集履歴

1

一部コードが違っていた。

2021/02/05 10:46

投稿

tanakana
tanakana

スコア150

test CHANGED
@@ -1,4 +1,4 @@
1
- こんな感じですかね
1
+ 修正しました。
2
2
 
3
3
 
4
4
 
@@ -6,15 +6,17 @@
6
6
 
7
7
  func SteIdou(bbb:String){
8
8
 
9
- let bundleName = Bundle.main.infoDictionary?[kCFBundleNameKey as String] as? String
9
+ let bundleName = Bundle.main.infoDictionary?[kCFBundleNameKey as String] as? String
10
10
 
11
- let fullName = "(bundleName!).(bbb)"
11
+ let fullName = "(bundleName!).(bbb)"
12
12
 
13
- let sceneType = NSClassFromString(fullName) as! SKScene.Type
13
+ let sceneType = NSClassFromString(fullName) as! SKScene.Type
14
14
 
15
- let scene = sceneType.init(size: self.size)
15
+ var scene = sceneType.init(size: self.size)
16
16
 
17
+ scene = sceneType.init(fileNamed: bbb)!
18
+
17
- let tr = SKTransition.fade(withDuration: 1)
19
+ let tr = SKTransition.fade(withDuration: 1)
18
20
 
19
21
  self.view!.presentScene(scene,transition: tr)
20
22