赞
踩
要先建立Text文本, using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class move : MonoBehaviour { public Text fenshu; public Text ying; void Start() { ying.gameObject.SetActive(false);文本默认是不显示的 } private void OnTriggerEnter(Collider other) { Destroy(other.gameObject); fenshu.text = "分数:" + ++score; if(score==5) { ying.gameObject.SetActive(true);//显示文本 } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。