unity hide/show text
2024-10-06 18:28:09
using UnityEngine;
using System.Collections;
public class PlayerController:MonoBehaviour
{
public UnityEngine.UI.Text winText;
void Start(){
winText.text = "You Win!";
winText.gameObject.SetActive (false); //hide winText
}
....
void OnTriggerEnter(Collider other){
if (other.gameObject.tag == "Coin") {
other.gameObject.SetActive(false); //hide coin
winText.gameObject.SetActive(true); //show winText
}
}
}
最新文章
- 如何权衡自己的angular水准
- OncrickListener的实现
- JSP 核心标签库
- 安卓和ios的lineheight的不一样如何解决?
- WPF中多个RadioButton绑定到一个属性
- PHP Code Reviewing Learning
- IO流 总结三
- 您可能不知道的ASP.Net小技巧
- PHP+Mysql-表单数据插入数据库及数据提取完整过程
- Spyder调试错误-";TypeError: decoding Unicode is not supported";
- PC或者手机弹出窗效果
- 使用Spring Boot Actuator、Jolokia和Grafana实现准实时监控
- ZOJ 4097 Rescue the Princess
- list按照某个元素进行排序
- HTML超级链接详细讲解
- Stack&;&;Queue
- 全网最详细的Windows系统里PLSQL Developer 64bit的下载与安装过程(图文详解)
- Rx编程的第一步是将native对象转换为monad对象
- C 语言 static、extern与指针函数介绍
- 分布式系统的烦恼------《Designing Data-Intensive Applications》读书笔记11
热门文章
- C语言:strcpy()和memcpy()
- [android错误] requires API level *
- Python网络爬虫 - 下载图片
- Internal Server Error: /favicon.ico 的解决方法
- Java从零开始学四十(反射简述一)
- python之函数用法basestring
- servlet Servlet例子
- &;和&;&;的一点区别
- wordpress调用函数大全
- LRM-00109-ORACLE启动报错