GUI 깜박임[C#]
2127 단어 GUI
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();
}
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
AWS RDS의 MariaDB에서 데이터베이스 이름에 하이픈을 사용하려는 경우의 조치MariaDB (Mysql)의 데이터베이스 이름에 하이픈을 넣고 싶다면 CREATE DATABASE를 직접 접으십시오. 이 때 데이터베이스 이름은 백 쿼트로 묶어 보자. AWS RDS의 GUI에서는 "-"가 금지 문...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.