teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

参照先のEnemyDataクラスを追記しました。

2019/06/15 13:58

投稿

terrat
terrat

スコア14

title CHANGED
File without changes
body CHANGED
@@ -28,4 +28,20 @@
28
28
  ", 経験値は" + enemyData.exp +
29
29
  ", ゴールドは" + enemyData.gold + "です。");
30
30
  }
31
+ ```
32
+ 下は参照先のEnemyDataクラスです。
33
+ ```C#
34
+ using System.Collections;
35
+ using System.Collections.Generic;
36
+ using UnityEngine;
37
+
38
+ [CreateAssetMenu(menuName = "MyScriptable/Create EnemyData")]
39
+ public class EnemyData : ScriptableObject {
40
+ public string enemyName;
41
+ public int maxHp;
42
+ public int atk;
43
+ public int def;
44
+ public int exp;
45
+ public int gold;
46
+ }
31
47
  ```