UNITY | PROJECT | RPG Tutorial |6. UI Buttons

2
Adding UI – Panel
3
Adding UI-Text
4
Adding Aceept Button |  UI-Button
5
Adding Font
6
Adding Font
7
Adding Decline Button
7-1
Buttons Working
8
Adding Quest Infromation | UI-Text
9
Creating Animation | Animation Tap
11
Creating Animation | Animation Tap
12
Creating Animation | Animation Tap
13
Creating Animation | Animation Tap
14
Crating Animation | Animation Tap
  • for the Quest Information UIs to appear with Animation, Create an Animation
    • For 0s, 60s, 6s, and 8s, change the Alpha value
10
Animation | Loop Time.
  • Animation Created
  • Deselect Loop time to prevent UI from appearing continously
15
Duplicating UI
202.png
“QuestManager” Script
  • create a script for Quests
  • create a static variable to use it in the other script(class)
  • create another variable a path for the static variable
  • in Update() method,
    • update the quest number
16
“Quest001 Buttons” script
  • create GameObjects variable as references
  • create a function, AcceptQuest(),
    • make Player and noticeCamera Active
    • make UI QuestLabel Inactive
    • start a Coroutine, SetQuestUI()
  • Create an IEnumerator()
    • put texts in the UIs
      • UI has Text component in itself
      • Getcomponent<>().text means accessing the text component
      • make UIs appear in order by using Coroutine
      • finally, make the UIs disappear
17
Creating QuestButtonManager from Empty GameObject
18
Setting Quest UIs off

18-1

19
Setting Acting for Button
  • in Accept Button,
    • add QuestButtonManager into On Click()
    • set the Action by accessing Quest001Button script
21
“Quest001” Script
  • for the mouse cursor to appear
    • add Screen.lockCursor
    • add Cursor.visible