728x90
Coroutine skipCoroutine = null;
EventSystem = eventSystem;
void Start()
{
eventSystem = GameObject.Find("EventSystem").GetComponent<EventSystem>();
}
void SkipFunc()
{
PlayBT.image.sprite = playSelectedImg; //플레이버튼 선택 이미지
PauseBT.image.sprite = pauseDefaultImg; //일시정지버튼 비활성화 이미지
if (skipCoroutine == null)
{
skipCoroutine = StartCoroutine("SkipCoroutineFunc");
}
else if(skipCoroutine != null)
{
StopCoroutine(skipCoroutine);
skipCoroutine = StartCoroutine("SkipCoroutineFunc");
}
//스킵 버튼 눌렀을 때 동작해야는 것 기술
}
IEnumerator SkipCoroutineFunc()
{
yield return new WaitForSeconds(1.0f);
eventSystem.SetSelectedGameObject(PlayBT.gameObject);
}
728x90
반응형
'Unity3D > Unity & C#' 카테고리의 다른 글
Unity & C# ~ 코루틴으로 회전하기 (Rotate Coroutine) (0) | 2022.05.31 |
---|---|
Unity & C# ~ Button Sprite Swap Scirpt Controller (0) | 2022.05.31 |
Unity & C# ~ Singleton(싱글톤) (0) | 2022.05.20 |
Unity & C# ~ String.Format 자리수 (0) | 2022.04.27 |
Unity & C# ~ Property 프로퍼티 (0) | 2022.04.27 |