纳金网

标题: GUI闪烁效果[C#] [打印本页]

作者: 晃晃    时间: 2011-8-22 08:33
标题: GUI闪烁效果[C#]

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(***e)
                {
                        displaySysLabel = ***e;
                        yield return new WaitForSeconds(0.5f);
                        displaySysLabel = false;
                        yield return new WaitForSeconds(0.5f);
                }
        }
        IEnumerator flashFriLabel()
        {
                while(***e)
                {
                        displayFriLabel = ***e;
                        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 == ***e)
                {
                        GUI.Label(new Rect(45,25,16,16),SysInfo,style);
                }
                GUI.Label(new Rect(61,25,16,16),"0",style);
                if(displayFriLabel == ***e)
                {
                        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();
        }
}
作者: 难骑    时间: 2011-9-3 08:02
提示: 作者被禁止或删除 内容自动屏蔽
作者: 晃晃    时间: 2012-1-22 23:29
年末来了,事情也多了!总结一年的经验,续写明年的计划!亲爱的朋友们,要注意身体,要开开心心的工作,健健康康的生活,舒舒服服的过年!

作者: 奇    时间: 2012-2-8 23:18
百度的叫度娘,网易的叫易娘,新浪内部还在为是叫新娘还是浪娘而争论不休!……不管你们是企鹅的额娘,豆瓣的伴娘,还是华为的伪娘,都要记得,淘宝才是你们的亲娘啊!亲!!

作者: 奇    时间: 2012-2-12 23:23
都闪开,介个帖子,偶来顶

作者: 菜刀吻电线    时间: 2012-3-22 23:21
读铁系缘分,顶铁系友情

作者: 奇    时间: 2012-4-1 23:30
灌水。。。

作者: tc    时间: 2012-6-18 23:18
先垫一块,再说鸟

作者: C.R.CAN    时间: 2012-7-31 23:21
加精、加亮滴铁子,尤其要多丁页丁页

作者: 奇    时间: 2012-8-25 23:53
不会吧,太恐怖了

作者: 菜刀吻电线    时间: 2012-10-9 23:18
我是老实人,我来也!

作者: 晃晃    时间: 2013-2-1 23:33
都闪开,介个帖子,偶来顶

作者: tc    时间: 2013-2-3 23:20
已阵亡的 蝶 随 风 舞 说过  偶尔按一下 CTRL A 会发现 世界还有另一面

作者: 奇    时间: 2013-2-3 23:26
呵呵,很好,方便罗。





欢迎光临 纳金网 (http://course.narkii.com/club/) Powered by Discuz! X2.5