monster脚本 using System.Collections; using System.Collections.Generic; using UnityEngine; public class monster : MonoBehaviour { public GameObject monsterObj; public float monster_hp; public float monster_atk; public float monster_def; public float monster_mdf; // Use this for initialization void Start () { } // Update is called once per frame void Update () { if (monster_hp < 0) { DestroyObject(monsterObj); } } public void monster_hpSet(float a) { monster_hp = a; } public float monster_hpGet() { return monster_hp; } public void monster_atkSet(float a) { monster_atk = a; } public float monster_atkGet() { return monster_atk; } public void monster_defSet(float a) { monster_def = a; } public float monster_defGet() { return monster_def; } public void monster_mdfSet(float a) { monster_mdf = a; } public float monster_mdfGet() { return monster_mdf; } }