GUI闪烁效果
来源:互联网 发布:上海行知学院怎么样 编辑:程序博客网 时间:2024/05/21 09:23
using UnityEngine;
using System.Collections;
public class MainBoardTop : MonoBehaviour
{
public Texture2D Logo;
public Texture2D SysInfo;
public Texture2D FriInfo;
public Texture2D IcoHelp;
public GUIStyle style;
public GUIStyle pathStyle;
private bool displaySysLabel = false;
private bool displayFriLabel = false;
IEnumerator Start()
{
yield return StartCoroutine(flashSysLabel());
yield return StartCoroutine(flashFriLabel());
}
IEnumerator flashSysLabel()
{
while(true)
{
displaySysLabel = true;
yield return new WaitForSeconds(0.5f);
displaySysLabel = false;
yield return new WaitForSeconds(0.5f);
}
}
IEnumerator flashFriLabel()
{
while(true)
{
displayFriLabel = true;
yield return new WaitForSeconds(0.5f);
displayFriLabel = false;
yield return new WaitForSeconds(0.5f);
}
}
void OnGUI()
{
GUI.BeginGroup(new Rect(0, 0, 300, 100));
GUI.Button(new Rect(3,5,37,37),Logo,style);
GUI.Button(new Rect(45,8,150,15),"test",pathStyle);
if(displaySysLabel == true)
{
GUI.Label(new Rect(45,25,16,16),SysInfo,style);
}
GUI.Label(new Rect(61,25,16,16),"0",style);
if(displayFriLabel == true)
{
GUI.Label(new Rect(77,25,16,16),FriInfo,style);
}
GUI.Label(new Rect(93,25,16,16),"0",style);
GUI.Label(new Rect(108,25,16,16),IcoHelp,style);
GUI.EndGroup();
}
}
0 0
- GUI闪烁效果
- Unity3d GUI闪烁效果
- [unity3d程序] GUI闪烁效果[C#]
- 闪烁效果
- Alpha 闪烁效果
- Alpha 闪烁效果
- 窗体闪烁效果
- js图片闪烁效果
- 文字闪烁效果
- 星星闪烁效果
- 页面背景闪烁效果
- CSS3元素闪烁效果
- CSS3元素闪烁效果
- flex 闪烁效果
- 文字闪烁效果
- css 闪烁效果
- CSS3元素闪烁效果
- 实现文字闪烁效果
- gcc & g++ 编译器命令简介
- 考试容易了,学习怎么办?
- chrome插件使用
- Hacmp 5.1 的配置方法
- nginx优化之request_time 和upstream_response_time差别
- GUI闪烁效果
- nginx优化之请求直接返回json数据
- tcp udp优缺点及使用场景
- 通信专业学生的迷茫
- MongoDB connection
- 小递归
- 常用PHP函数(数组、字符串、文件、日期、图像)
- MongoDB oplog
- ArcGIS Runtime SDK for Android----Release notes for 10.2.3