Skip to content

Instantly share code, notes, and snippets.

@HassakuTb
Created April 19, 2016 05:30
Show Gist options
  • Save HassakuTb/46413f772322b39331556fc3d59ae625 to your computer and use it in GitHub Desktop.
Save HassakuTb/46413f772322b39331556fc3d59ae625 to your computer and use it in GitHub Desktop.
using UnityEngine;
[CreateAssetMenu(menuName = "ScriptableObject/Enemy", fileName = "NewEnemy")]
public class Enemy : ScriptableObject{
public string Name;
public int HpMax;
public int Power;
private int hp;
protected virtual void OnEnable() {
hp = HpMax;
}
public virtual void Damage(int damageValue){
hp -= damageValue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment