RefreshUI(); 기능이 궁금합니다.
293
Eunu Sa
4 asked
0
UI_ConfirmPopup.cs 파일에서 RefreshUI(); 함수 기능이 궁금합니다.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static Define;
public class UI_ConfirmPopup : UI_Popup
{
enum Texts
{
MessageText
}
enum Buttons
{
YesButton,
NoButton
}
string _text;
public override bool Init()
{
//초기화를 안전하게 사용해도 되는지 확인하는 과정
//base.Init()이 true면 초기화 과정이 되어 있음.
if (base.Init() == false)
return false;
BindText(typeof(Texts));
BindButton(typeof(Buttons));
GetButton((int)Buttons.YesButton).gameObject.BindEvent(OnClickYesButton);
GetButton((int)Buttons.NoButton).gameObject.BindEvent(OnClickNoButton);
GetText((int)Texts.MessageText).text = _text;
RefreshUI();
return true;
}
Action _onClickYesButton;
/// <summary>
/// 람다식 실행을 위한 콜백함수
/// </summary>
/// <param name="onClickYesButton"></param>
/// <param name="text"></param>
public void SetInfo(Action onClickYesButton, string text)
{
_onClickYesButton = onClickYesButton;
_text = text;
RefreshUI();
}
void RefreshUI()
{
if (_init == false)
return;
}
void OnClickYesButton()
{
Managers.UI.ClosePopupUI(this);
Managers.Sound.Play(Sound.Effect, "Sound_CheckButton");
if (_onClickYesButton != null)
_onClickYesButton.Invoke();
}
void OnClickNoButton()
{
Managers.Sound.Play(Sound.Effect, "Sound_CancelButton");
OnComplete();
}
void OnComplete()
{
Managers.UI.ClosePopupUI(this);
}
}
unity
Answer 1
dotween pro와 dotween
0
102
2
SceneType 질문
0
57
2
소스코드 문의
0
76
1
유니티6 6000.0.0.35f1 버전을 사용하는데 잘 됩니다~
0
356
1
코드 분석하면서 강의 복습중인데 질문 있습니다!
0
222
1
이전에 프레임웍을 만들때라는 말씀
0
217
1
Missing (Mono Script)
0
407
1
그냥 씬 자체가 실행이 안됩니다..
0
645
2
어떡하죠?
0
688
2
unity 다운 시간
0
279
0
바인드가 안돼요
0
321
1
Update문을 호출하기전에 왜 호출하는게 자기자신인지 확인하나요?
0
198
1
안녕하세요! 시작...부터 조금 막혔어요..ㅠㅠ 도와주세요
0
4710
2
버튼 조작을 해주는 스크립트 위치
0
297
1
Action Invoke할때 ?는 뭔가요?
1
425
1
데이터 읽기 쓰기에 관련해서 질문 있습니다.
0
383
1
Scene탭에 Auto Save 어떻게 활성화시키나요?
0
1356
1
루키스님 바쁘시겠지만 혹시 한 번만 봐주실 수 있나요?
0
440
1
함수호출 순서관련해서 질문있습니다.
0
427
1
DataManager 관련 질문
0
458
2
갑자기 바인드가 되지 않습니다.ㅠㅠ
0
371
1
저작권 관련 질문이 있습니다.
1
518
1
Visual studio 스타일
0
435
1
Sprite Image vs UI Image
0
912
1

