Skip to content

Instantly share code, notes, and snippets.

@todorok1
Last active January 29, 2019 12:56
Show Gist options
  • Select an option

  • Save todorok1/339c6d14714d4af03ea054c1b1af8532 to your computer and use it in GitHub Desktop.

Select an option

Save todorok1/339c6d14714d4af03ea054c1b1af8532 to your computer and use it in GitHub Desktop.
ScriptableObjectのテスト用に使うキャラクターのコントローラ
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScriptableCharaController : MonoBehaviour {
public EnemyData enemyData;
void Start(){
ShowScriptableObjectData();
}
void Update(){
}
void ShowScriptableObjectData(){
// 参照しているEnemyDataの中身をコンソールに表示する
Debug.Log("私の名前は" + enemyData.enemyName +
", 最大HPは" + enemyData.maxHp +
", 攻撃力は" + enemyData.atk +
", 防御力は" + enemyData.def +
", 経験値は" + enemyData.exp +
", ゴールドは" + enemyData.gold + "です。");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment