본문 바로가기

전체 글183

23/09/06 LearnUGUI (Stage 2) 1단계 처음 실행하면 1번 Stage : Doing 상태 2~18번 Stage의 state : Lock 상태 클릭하면 StageNum과 state 출력하기 **오류 발생! 1번 UIStage만 눌렀을 때 콘솔이 나오지 않았다 => 알고보니 UIStage에만 Button이 붙어져 있는게 아니라 그 아래 lock,doing,complete에도 Button이 붙어져 있었다. Button떼어내니 잘 나온다ㅎㅎ UIStage using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using UnityEngine.UI; public class UIStage : MonoBehaviour { public enu.. 2023. 9. 6.
23/09/06 LearnUGUI (Stage 1) **메모장에 구현할 것들 정리 한 페이지에 표시가능 UIStgae 수 : 18개 총 UIStage : 28 1페이지: 18개 1~18 2페이지: 10개 19~28 처음: 끝페이지 번호 - (표시가능 UIStage수(18) -1) 끝: 페이지 번호 * 표시가능 UIStage수(18) (단! 마지막 페이지에서는 총 페이지 수 나타내기) EX) 1페이지 처음: 1 끝: 18 2페이지 처음: 19 끝: 36 3페이지 처음: 37 끝: 54 . . . 이전 페이지 버튼, 다음 페이지 버튼 뒤로가기 버튼 누르면 "뒤로 가기" 출력 닫기 버튼(팝업) 뒤로가기 버튼(페이지) 현재 페이지를 저장해야함 이전페이지 클릭 -> 현재페이지 -1 다음페이지 클릭 -> 현재페이지 +1 현재페이지가 1페이지면? 이전페이지 버튼 없음.. 2023. 9. 6.
23/09/05 복습할 거 (UIStage 3단계 마무리해라!) 처음: 맨 앞에거만 doing 나머지는 lock DOING상태일때 클릭하면 상태 출력 다음 스테이지가 있는지 검사 다음 스테이지: 현재스테이지 +1 if(다음스테이지 2023. 9. 5.
23/09/05 LearnUGUI (UIStage) 버튼 누르면 해당 state에 해당하는 게임오브젝트 활성화시키기 Test02UIMain using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Test03UIMain : MonoBehaviour { [SerializeField] private Button[] arrBtns; [SerializeField] private UIStage uiStage; [SerializeField] private void Start() { this.uiStage.Init(1); for(int i =0; i < this.arrBtns.Length; i++) { Button btn .. 2023. 9. 5.
23/09/05 LearnUGUI (InputField) ㅜㅡㅜ 나는 말하는 감자............. 처음에 아래와 같이 코드를 썼는데 using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class Test01InputField : MonoBehaviour { private TMP_InputField input; void Start() { this.input = this.GetComponent(); this.input.onValueChanged.AddListener((str) => { Debug.Log(str); }); //Debug.Log(input); } } 밑에와 같이 콘솔 부분에 입력한 .. 2023. 9. 5.
23/09/04 LearnUGUI 종합(Button,On/Off,Tab,Slider) SceneMain using System.Collections; using System.Collections.Generic; using UnityEngine; public class Test01Main : MonoBehaviour { [SerializeField] private Test01UIMain uiMain; void Start() { //uiMain에 입력된 버튼 타입을 가져와서 출력 this.uiMain.onButtonClicked = (btnType) => { Debug.Log(btnType); }; this.uiMain.Init(); } } Test01UIMain using System; using System.Collections; using System.Collections.Generic.. 2023. 9. 4.