从另一个脚本访问变量/函数
Enemy_Stats
& Character_Stats
void OnCollisionEnter(Collision collision){ if (collision.gameObject.tag == "Enemy") { collision.gameObject.GetComponent<Enemy_Stats>().Health = collision.gameObject.GetComponent<Enemy_Stats>().Health - gameObject.GetComponent<Character_Stats>().AttackDamage; if (collision.gameObject.GetComponent<Enemy_Stats>().Health <= 0) { Destroy(collision.gameObject); } }}
collision.Health
?
沧海一幻觉
牧羊人nacy
Cats萌萌