public class xiao : MonoBehaviour { protected AudioSource DeathAudio; // Use this for initialization void Start () { DeathAudio = GetComponent<AudioSource>(); } // Update is called once per frame void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Pick")) { GameManager.AddScore(); if (other.tag == "man") { } other.gameObject.SetActive(false); DeathAudio.Play();
你在分数计算的函数里面加多个分数判断就可以了,并将判断结果作为返回值,每次调用就知道能否满十五分了
您的问题已经有小伙伴解答了,请点击【采纳】按钮,采纳帮您提供解决思路的答案,给回答的人一些鼓励哦~~
ps:开通问答VIP,享受5次/月 有问必答服务,了解详情↓↓↓
【电脑端】戳>>> https://vip.csdn.net/askvip?utm_source=1146287632
【APP 】 戳>>> https://mall.csdn.net/item/52471?utm_source=1146287632