Files
WhaleAdventure_VR/Assets/My project/Memory Scripts/UI/README_KR.md
skrwns304@gmail.com b1e85a5b89 2026-06-19 UI, UI로직
2026-06-19 14:27:40 +09:00

5.5 KiB

기억의 조각 진행도 UI 스크립트 설명서

이 패키지는 기억의 조각 0/5 ~ 5/5 진행도를 UI에 표시하고, 리듬게임/낚시/미니게임 성공 시 기억의 조각을 지급하기 위한 스크립트 세트입니다.

포함 파일

MemoryProgressUI.cs
MemoryProgressManager.cs
MemoryPieceReward.cs
MemoryPiecePickup.cs
MemoryProgressPopupUI.cs

1. Unity에 넣을 위치

추천 경로:

Assets/My project/MemoryProgress/Scripts

위 폴더를 만들고 .cs 파일들을 넣으세요.


2. 필요한 UI Hierarchy

기억의 조각 UI는 아래 구조를 추천합니다.

MemoryProgressCanvas
└── MemoryProgressUI
    ├── ProgressBG
    ├── TitleText
    ├── PieceSlotRoot
    │   ├── PieceSlot_01
    │   │   ├── EmptyIcon
    │   │   ├── FilledIcon
    │   │   └── GlowIcon
    │   ├── PieceSlot_02
    │   ├── PieceSlot_03
    │   ├── PieceSlot_04
    │   └── PieceSlot_05
    └── CountText

중요:

  • EmptyIcon은 항상 켜둡니다.
  • FilledIcon은 처음에 꺼둡니다.
  • GlowIcon은 선택 사항입니다. 처음에는 꺼둡니다.
  • CountText는 TextMeshProUGUI로 만듭니다.

3. MemoryProgressUI.cs 붙이는 곳

붙일 오브젝트:

MemoryProgressUI

Inspector 연결:

Title Text  → TitleText
Count Text  → CountText
Filled Icons 배열
  Element 0 → PieceSlot_01/FilledIcon
  Element 1 → PieceSlot_02/FilledIcon
  Element 2 → PieceSlot_03/FilledIcon
  Element 3 → PieceSlot_04/FilledIcon
  Element 4 → PieceSlot_05/FilledIcon

Glow Icons 배열 선택
  Element 0 → PieceSlot_01/GlowIcon
  Element 1 → PieceSlot_02/GlowIcon
  Element 2 → PieceSlot_03/GlowIcon
  Element 3 → PieceSlot_04/GlowIcon
  Element 4 → PieceSlot_05/GlowIcon

설정 추천:

Max Pieces: 5
Title: 기억의 조각
Show Glow Only When Completed: true

4. MemoryProgressManager.cs 붙이는 곳

빈 오브젝트를 만듭니다.

MemoryProgressSystem

여기에 붙입니다.

MemoryProgressManager.cs

Inspector 연결:

Memory Progress UIs 배열
  Element 0 → MemoryProgressUI 오브젝트

Required Pieces: 5
Current Pieces: 0

여러 UI에 동시에 표시하고 싶다면 배열에 여러 개를 넣으면 됩니다. 예: HUD용 작은 진행도 UI, 방 선택 화면용 큰 진행도 UI.


5. MemoryPieceReward.cs 붙이는 곳

미니게임 오브젝트에 붙입니다.

예:

RhythmGameSystem
FishingGameSystem
BlackjackGameSystem
MazeGameSystem

Inspector 연결:

Memory Progress Manager → MemoryProgressSystem의 MemoryProgressManager
Reward Amount → 1
Give Only Once → true
Auto Find Manager → true 또는 false

리듬게임 성공 시 연결 예시

RhythmGameManager 컴포넌트의 이벤트에서:

On Game Success
+ 버튼 클릭
RhythmGameSystem 오브젝트 드래그
MemoryPieceReward → GiveReward()

이렇게 하면 리듬게임 성공 시 기억의 조각이 1개 증가합니다.


6. MemoryPiecePickup.cs 선택 사용

기억의 조각을 실제 월드 오브젝트로 만들어 플레이어가 직접 획득하게 할 때 사용합니다.

붙일 오브젝트:

MemoryPiece_Object

필요 조건:

Collider
Is Trigger: true
Player 오브젝트 Tag: Player

또는 XR Grab/Event에서 PickUp()을 직접 호출해도 됩니다.


7. MemoryProgressPopupUI.cs 선택 사용

기억의 조각을 얻었을 때 잠깐 뜨는 알림입니다.

추천 구조:

MemoryRewardPopup
├── PopupPanel
│   ├── PopupTitleText
│   └── PopupCountText

붙일 곳:

MemoryRewardPopup

Inspector 연결:

Popup Panel → PopupPanel
Title Text → PopupTitleText
Count Text → PopupCountText
Message → 기억의 조각을 얻었다!
Show Time → 1.5

MemoryProgressManagerOn Progress Changed 이벤트에 연결:

On Progress Changed
+ 버튼 클릭
MemoryRewardPopup 오브젝트 드래그
MemoryProgressPopupUI → ShowPopup(int, int)

8. 테스트 방법

  1. MemoryProgressSystemMemoryProgressManager를 붙입니다.
  2. MemoryProgressUIMemoryProgressUI.cs를 붙이고 FilledIcon 5개를 연결합니다.
  3. MemoryProgressManagerMemory Progress UIs 배열에 해당 UI를 넣습니다.
  4. 임시 버튼을 만들고 OnClick에 아래 함수를 연결합니다.
MemoryProgressManager → AddMemoryPiece()
  1. Play 후 버튼을 누르면 UI가 1 / 5, 2 / 5로 증가해야 합니다.

9. 리듬게임과 연결하는 방법

RhythmGameSystemMemoryPieceReward.cs를 추가합니다.

연결:

Memory Progress Manager → MemoryProgressSystem

RhythmGameManagerOn Game Success 이벤트에:

RhythmGameSystem → MemoryPieceReward.GiveReward()

이렇게 연결하면 리듬게임 성공 시 기억의 조각을 지급합니다.


10. 최종 체크리스트

MemoryProgressUI에 CountText가 연결되어 있는가?
FilledIcon 5개가 배열에 순서대로 들어갔는가?
MemoryProgressManager에 MemoryProgressUI가 연결되어 있는가?
MemoryPieceReward에 MemoryProgressManager가 연결되어 있는가?
미니게임 성공 이벤트에 MemoryPieceReward.GiveReward()가 연결되어 있는가?

이 구성이 완료되면 기억의 조각 진행도 UI는 다른 미니게임과 방 선택 UI에서도 재사용할 수 있습니다.