ClueBall Wiki - UAVisonline/Portfolio GitHub Wiki
๋ณด๋๊ฒ์ 'Clue'์ '์ซ์์ผ๊ตฌ'๋ฅผ ๊ฒฐํฉํ ๊ฒ์์ ์ ์, ์ด๋ฅผ 2๊ฐ์ง UI๋ก ํ๋ ์ดํด ์ ํธ๋๋ฅผ ์กฐ์ฌํ๋ HCI ํ๋ก์ ํธ
ํด๋น ๊ฒ์์ 'Clue'์ '์ซ์์ผ๊ตฌ'๋ฅผ ๊ฒฐํฉํ ๋์์ธ์ผ๋ก, ํ๋ ์ด์ด๋ ์ผ์ ๊ธฐํ๋งํผ ์ถ๋ฆฌ๋ฅผ ์งํํด ์ฉ์์, ๋ฒํ๋๊ตฌ, ๋ฒํ์ฅ์์ ๋ํ ์ ๋ณด๋ฅผ ์ป๋๋ค. ์ด๋ฌํ ์ ๋ณด๋ฅผ ์ป๋ ๊ณผ์ ์ ์ซ์์ผ๊ตฌ ์์ผ๋ก ์งํ๋๋ฉฐ, ๊ธฐํ๊ฐ ์ ๋ถ ์์ง๋๊ฑฐ๋ ์ ๋ณด๊ฐ ์ถฉ๋ถํ๋ค๊ณ ํ๋จํ๋ฉด ์ต์ข ์ถ๋ฆฌ๋ฅผ ์งํํด ์ ๋ต์ ๋ง์ถ ์ ์๋ค. ๋ํ ์ป์๋ ์ ๋ณด๋ฅผ ๊ธฐ๋กํ ์ ์๋ ์ ๋ณด Note๊ฐ ์ ๊ณต๋์ด ํ๋ ์ด์ด๋ ์ด๋ฅผ ์ด์ฉํด ์ด์ ์ ๋ณด๋ฅผ ํ๋ก๊ทธ๋จ ๋ด์์ ๊ธฐ๋กํ ์ ์๋ค. ํ๋ ์ด์ด๋ ์ฌ๊ธฐ์ 2๊ฐ์ง UI๋ฅผ ์ด์ฉํด ๊ฒ์์ ํ๋ ์ด ๊ฐ๋ฅํ๋ค.
ํด๋น ํ๋ก์ ํธ๋ 2022๋ 4์ HCI๋ฅผ ์๊ฐํ๋ฉด์ ์ฃผ์ ๋ฅผ ์ง์ ์ ์ ํ๋ ํ๋ก์ ํธ๋ฅผ ์งํํ ๋, 'UI๊ฐ ์ ํธ๋'๋ผ๋ ์ฃผ์ ๋ฅผ ์ ์ ํ๊ณ ์ด๋ฅผ ์กฐ์ฌํ๊ธฐ ์ํด ์งํ, ์๋ฃํ ๊ฒ์ ํ๋ก์ ํธ์ด๋ค.
ํด๋น ํ๋ก์ ํธ๋ฅผ ์งํํ๋ฉด์ ๊ทธ๋ํฝ ์์์ ๋ํด ์๋์ ๊ฐ์ UnityAsset์ ํ์ฉํ์ผ๋ฉฐ, ์ ์ ์คํฐ๋๋ฅผ ์ํด ๋จํก๋ฐฉ์ ๋ฐฐํฌ๋ฅผ ์งํํ์๋ค.
- Bags & boxes icons, Character avatar icons windows, fairytale icons megapack windows
- fantasy icons megapack, modern tools icons, monsters avatar icons windows
- fantasy gui, GUI PRO Kit - Sci Fi
ํด๋น ์ํค์์๋ ํ๋ก์ ํธ์ ๋ํด ์๋ ๋ค ํญ๋ชฉ์ ๊ดํด ์ค๋ช ํ๊ณ ์ ํ๋ค.
-
๋ ๊ฐ์ง UI๋ฅผ ๊ฒ์ ์์คํ ์์ ์ด๋ป๊ฒ ๊ตฌํํ์๋๊ฐ?
-
๋ฒํผ ๋ด ๋ค์ํ ๊ธฐ๋ฅ์ ์ด๋ป๊ฒ ๊ตฌํํ์๋๊ฐ?
-
์ ๋ณด Note๋ฅผ ์ด๋ป๊ฒ ๊ตฌํํ๋๊ฐ?
-
ํ๋ก์ ํธ์์ ์์ฌ์ด ์ ์ ๋ฌด์์ธ๊ฐ?
1. UI ์ธํฐํ์ด์ค๋ฅผ ์ํ ๊ธฐ๋ณธ ์์ ๋ฐ Script ์์ (InterfaceManager Script ๋ฐ ์ด๋ฅผ ์์๋ฐ์ Script)
Game์์๋ ๊ธฐ๋ณธํ, ๋ฐฉํฅํ ์ธํฐํ์ด์ค๊ฐ ์กด์ฌํ๋ฉฐ ํ๋ ์ด์ด๋ ๊ฒ์์ ์์ํ ๋ ์ด๋ค ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ ์ง ์ ํํด ํ๋ ์ดํ ์ ์๋ค. ์ด๋ฌํ ์ธํฐํ์ด์ค๋ ๋ฒํผ์ ์์น๊ฐ ๋ค๋ฅผ ๋ฟ, ๊ทธ ์ธ์๋ ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ค. ๋ฐ๋ผ์ ๋ ์ธํฐํ์ด์ค๋ฅผ ๊ตฌํํ๋๋ฐ ๋์์ด ๋๋ ๋ถ๋ชจ InterfaceManager Script๋ฅผ ์์ฑ, ์ด๋ ์๋์ ๊ฐ์ ๊ธฐ๋ฅ์ ๊ฐ์ง๊ณ ์๋ค.
-
9๊ฐ์ Button UI Script ๋ณ์
-
์ Button์ ์ ๋ถ SetActiveFalseํ๋ ํจ์ ( set_active_false )
-
์ถ๋ฆฌ ๋ฒํผ์ ๋ํด button ์ํธ์์ฉ์ ๊บผ๋ฒ๋ฆฌ๋ ํจ์ ( set_interactable_false_first_button, set_interactable_false_eighth_button )
-
Button UI์ ๋ํด CommandObject ๊ธฐ๋ฅ์ ํ ๋นํ๋ ํจ์ ( set_button_event(int index, CommandObject value, string str="") )
์ Script์ ๊ธฐ๋ฅ์ ํตํด ๊ธฐ๋ณธ์ ์ธ ์ฒญ์ฌ์ง์ ๋ง๋ค์์ผ๋ฉด ๊ฐ UI interface๋ ์ Script๋ฅผ ์์๋ฐ์ ์ ์ํ๋ค. ์ด ๋ ์ ๊ธฐ๋ฅ์ interface Script๊ฐ ๊ทธ๋๋ก ์ฌ์ฉํ ์ ์๋ ๊ฒฝ์ฐ, ํด๋น function์ ์ค๋ฒ๋ผ์ด๋ฉํด ๋ง์ถค ๋ณ๊ฒฝํด์ฃผ๋๋ก ํ๋ค.
์ด๋ฅผ ํตํด ํ์คํ interface Script(StandardInterfaceManager Script)๋ฅผ ์๋์ ๊ฐ์ด ์์ฑํ์๋ค.
33 public void set_number_of_choice(int value) // y_pos ์ค์ ์ ์ํ ํจ์ (์ ์ฒด ๋ณด๊ธฐ์ ๊ฐฏ์๋ฅผ ๋ถ๋ฌ์จ๋ค)
39 public override void set_button_event(int index, CommandObject value, string str = "") // ์ค๋ฒ๋ผ์ด๋ฉ
{
........
int tmp = current_button;
if(index==9) // back button์ ๋ํ ๊ฒฝ์ฐ
{
tmp = 9;
}
else // ๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ
{
current_button++;
}
switch (tmp)
{
case 1:
first_button.GetComponent<RectTransform>().anchoredPosition = new Vector2(0.0f, y_pos);
first_button.set_command_object(value, str);
break;
case 2:
second_button.GetComponent<RectTransform>().anchoredPosition = new Vector2(0.0f, y_pos);
second_button.set_command_object(value, str);
break; ....
์ 2๊ฐ์ function์ StandardInterface์์ ์ฃผ๋ก ์ฌ์ฉํ๋ ๊ธฐ๋ฅ์ผ๋ก, 39 Line์ ๊ธฐ์กด Button UI์ Command Object๋ฅผ ํ ๋นํ๋ ๊ธฐ๋ฅ์ ์ค๋ฒ๋ผ์ด๋ฉํด Button UI์ ์์น๋ ์ค์ ํ๋ ๊ธฐ๋ฅ์ ์ถ๊ฐํ์์ผ๋ฉฐ ์ด๋ฅผ ์ํด ํด๋น ํ์ด์ง์์ button UI๋ฅผ ๋ช ๊ฐ ์ฌ์ฉํ๋์ง ๋ฐ๋ set_number_of_choice function์ ์ ์ํ์๋ค.
๊ทธ๋ฆฌ๊ณ ๋ฐฉํฅํ interface Script(DirectionalInterfaceManager Script)๋ ์๋์ ๊ฐ์ด ์์ฑํ์๋ค.
29 public override void set_active_false()
{
base.set_active_false();
back_button.gameObject.SetActive(false); // Back Button False (Directional Interface๋ ๋ฐ๋ก BackButton์ Button UI๋ก ์ฌ์ฉ)
Circle.SetActive(false); // Circle Obejct False
}
public override void set_button_event(int index, CommandObject value, string str = "")
{
if(index!=0)
{
if(Circle.activeSelf==false)
{
Circle.SetActive(true);// ๊ฐ์์ฑ Object๋ฅผ True ์ํ๋ก ๋ณ๊ฒฝ
}
}
switch (index)
{
case 0:
back_button.set_command_object(value, str, false); // BackButton ํ ๋น
break;
case 1:
first_button.set_command_object(value, str, false);
break;
case 2:
second_button.set_command_object(value, str, false);
break; ...
Directional Interface Script๋ ๋ถ๋ชจ Script์ ํจ์๋ฅผ ์ค๋ฒ๋ผ์ด๋ฉํด ์๊ธฐ ์์ ์ด ํ์ํ๋๋ก ๋ณ๊ฒฝํ๋๋ฐ, set_active_falseํจ์๋ backButtonUI์ Circle Object๋ฅผ ๋นํ์ฑํ ํ๋ ๋ถ๋ถ์ ์ถ๊ฐํ์ผ๋ฉฐ, set_button_eventํจ์๋ backButtonUI๊ฐ ์๋ UI๋ฅผ ํ ๋นํ ๋ ๊ฐ์์ฑ์ ์ํด ๋ง๋ค์๋ Circle Object๋ฅผ ํ์ฑํ ํ๋ ๋ถ๋ถ์ ์ถ๊ฐํ๋ค.
์ UI๋ฅผ ๊ฒ์์ ์์ํ ๋ ์ ํํ ์ ์์ด์ผ ํ๋๋ฐ ์ฐ์ Player๊ฐ ๋ฌด์จ UI๋ฅผ ์ ํํ๋์ง ์์คํ ์ ๊ธฐ๋กํด์ผ ํ๋ค. ์ด๋ ๊ฒ์ ์ ์ฒด์ ์์ด์ ๋ฐ์ดํฐ๋ฅผ ๊ด๋ฆฌํ๋ GameManager Script๋ด ์๋ ๋ด์ฉ์ ํตํด ํด๊ฒฐํ์๋ค.
40 private Interface_mode interface_mode;
42 [SerializeField] private GameObject mainScreenCanvas;
[SerializeField] private GameObject standardInterfaceCanvas;
[SerializeField] private GameObject directionInterfaceCanvas;
...
158 public void set_interface_mode(Interface_mode value)
{
interface_mode = value;
mainScreenCanvas.SetActive(false); // Mainํ๋ฉด Off
switch(interface_mode) // Interface mode์ ๋ฐ๋ฅธ InterfaceCanvas ์ํ ์ค์
{
case Interface_mode.standard:
standardInterfaceCanvas.SetActive(true);
directionInterfaceCanvas.SetActive(false);
break;
case Interface_mode.direction:
standardInterfaceCanvas.SetActive(false);
directionInterfaceCanvas.SetActive(true);
break;
}
}
...
์ ๋ด์ฉ 40 Line์์ ์ด๋ค Interface๋ฅผ ์ ํํ๋์ง ์ ์ฅํ๋ฉฐ, 42~44 Line์์ ํด๋น Interface Object ๋ฐ ๋ฉ์ธํ๋ฉด Object๋ฅผ ์ฐ๊ฒฐํ๋ค. ๊ทธ ๋ค Interface mode๋ฅผ ์ ํํ๋ ๋ฒํผ์ ๋๋ฅด๋ฉด ํด๋น ๋ฒํผ์์ ์ set_interface_mode์ ํธ์ถํ๋ค. ํด๋น ํจ์์์๋ Mainํ๋ฉด์ ์ข
๋ฃํ๊ณ interface ์ข
๋ฅ์ ๋ง๋ Canvas๋ฅผ ActiveTrueํ์ฌ ์ค์ ๊ฒ์์ ์์ด์ ํด๋น Interface๋ฅผ ์ฌ์ฉํ ์ ์๊ฒ ํด์ค๋ค.
Game์๋ Interface ์ ํ ์ธ์๋ ํ์ด์ง ์ด๋, ๋ค๋ก๊ฐ๊ธฐ, ์ฉ์์/๋ฒํ์ฅ์/๋ฒํ๋๊ตฌ ์ ํ๊ณผ ๊ฐ์ ๊ธฐ๋ฅ์ ์ํ๊ณ ์์ผ๋ฉฐ, ์ด ์ค ์ผ๋ถ ๋ฒํผ์ ๊ธฐ๋ฅ๋ค์ Interface Canvas ๋ด ์กด์ฌํ๋ Button์์ ์ฌ์ฉํด์ผ ํ๋ค. ๊ทธ๋ฌ๋ ์ด๋ฌํ Interface์ Button์ ๊ธฐ๋ฅ๋ง๋ค ๋ง๋๋ ๊ฒ์ ๊ต์ฅํ ์๊ฐ์ด ๋ง์ด ์๋ชจ๋๋ฉฐ ๊ด๋ฆฌ๋ ์ด๋ ต๊ธฐ ๋๋ฌธ์, ํ ๊ฐ์ Button์์ ๊ธฐ๋ฅ์ ๊ต์ฒดํ๋ ์์ ์ด ํ์ํ๋ฉฐ ์ด๋ฅผ ์ํด Button์ ๋ฃ์ ๊ธฐ๋ฅ์ ์ ๋ถ ๋์ผํ Script ์์์ ํตํด ๋ง๋ค์ด์ผ ํ๋ค.
public interface Command // Design Pattern - Command
{
void execute();
//void de_execute();
}
public abstract class CommandObject : MonoBehaviour, Command
{
abstract public void execute();
//abstract public void de_execute();
}
Button์ ๋ฃ์ด์ ์ฌ์ฉํ ๊ธฐ๋ฅ์ ์ Script์ Design Pattern - Command๋ฅผ ์ด์ฉํด ์ ์, ํด๋์ค CommandObject๋ฅผ ์ ์ํ์ฌ Button์ ๊ธฐ๋ฅ์ CommandObject๋ฅผ ์์๋ฐ์ execute ํจ์๋ฅผ ์ค๋ฒ๋ผ์ด๋ฉํ๋ ๊ฒ์ผ๋ก ๊ตฌํํ ์ ์๋ค. ๊ทธ ์ค Interface์ ๋ฐ๋ผ Button์ ๊ธฐ๋ฅ์ ๊ต์ฒดํ๋ ๊ฒ์ ButtonCommandObject๋ฅผ ํตํด ๊ตฌํํ์ผ๋ฉฐ ์ด๋ฅผ ์ด์ฉํด ์๋ ๊ธฐ๋ฅ์ ๊ตฌํํ์๋ค.
- ๋ค๋ก๊ฐ๊ธฐ ๊ธฐ๋ฅ (BackSpace_Command Script)
- ์ฉ์์/๋ฒํ๋๊ตฌ/์ฅ์ ์ ํ ๊ธฐ๋ฅ (Human_Command, Place_Command, Tool_Command Script)
- ๋จ์ Page ์ด๋ ๊ธฐ๋ฅ (ActiveCommand Script)
๊ทธ๋ฆฌ๊ณ Interface Canvas์ ์กด์ฌํ๋ ๋ค์ํ Button๋ค์ ์๋ Script์ set_command_object ํจ์๋ฅผ ํตํด CommandObject์ ์ฐ๊ฒฐํ ์ ์์ผ๋ฉฐ, click_event ํจ์๋ฅผ ํตํด์ ์คํ์กฐ๊ฑด์ด ๋ง๋ ๊ฒฝ์ฐ CommandObject์ execute ๊ธฐ๋ฅ์ ์คํํ๋ ์ญํ ์ ํ ์ ์๋ค.
public void click_event()
{
//Debug.Log(this.gameObject.name);
if (command_object!=null && GameManager.gamemanager.get_pause()==false) // ์ผ์์ ์ง ์ ์
๋ ฅ ๋ถ๊ฐ๋ฅํ๊ฒ ์์
{
GameManager.gamemanager.click_play(); // ํด๋ฆญ ์๋ฆฌ ์ฌ์
interface_manager.set_active_false(); // Canvas ๋ด ๋ฒํผ ์ค๋ธ์ ํธ ๋นํ์ฑํ
command_object.execute(); // Command Objecct ๊ธฐ๋ฅ ์คํ
}
}
public void set_command_object(CommandObject value, string str, bool number_marking = true)
{
command_object = value; // command obejct ํ ๋น
set_text(str, number_marking); // ๋ฒํผ text ์ค์ (์ซ์๋ ๋ณด์ด๊ฒ ํ ๊ฒ์ธ๊ฐ?)
this.gameObject.SetActive(true); // ๋ฒํผ Setactive True
}
์ ๋ณดNote๋ ํ๋ ์ด์ด์ ์ด์ ์ถ๋ฆฌ๋ฅผ ํตํด ์ป์ ์ ๋ณด๋ฅผ ์ ์ฅํ๊ณ ์์ผ๋ฉฐ, ํ๋ ์ด์ด๊ฐ ์๊ฑฐ๋ฒ์ ํตํด ์ ๋ณด๋ฅผ ๋ฐฐ์ ํ๋๋ฐ ๋ฌด์์ ๋ฐฐ์ ํ ์ง ์๊ฐ์ ์ผ๋ก ํฐ ๋์์ ์ฃผ๊ณ ์๋ค. ์ด๋ Information_List Script๋ฅผ ํตํด ์ฒ๋ฆฌํ๊ณ ์๋๋ฐ, ํด๋น Script๋ ์๋์ ๊ฐ์ ๊ธฐ๋ฅ์ ๊ฐ์ง๊ณ ์๋ค.
- ์ฉ์์/๋ฒํ๋๊ตฌ/๋ฒํ์ฅ์์ ๊ฐ์ ScriptableObject List ๋ฐ ๊ฐ ์นดํ ๊ณ ๋ฆฌ์ ํด๋นํ๋ Information_update Script
- ์ List ๋ด๋ถ ScriptableObject ์์ ์๋ ์ง์ญ๋ณ์์ ์ ๊ทผํ ์ ์๋ ํจ์
- ๊ฒ์ ์์ ์ ScriptableObject ๋ด ์ง์ญ๋ณ์๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ด๊ธฐํํ๋ ํจ์ (init_information)
- ํ๋ ์ด์ด์ ์ถ๋ฆฌ๊ฒฐ๊ณผ์ ๋ฐ๋ฅธ ScriptableObject ์ง์ญ๋ณ์ auto_cacl์ ์ค์ ํ๋ ํจ์ (zero_match, more_match)
์ ๊ธฐ๋ฅ์ ํตํด ์์คํ ์ ํ๋ ์ด์ด์ ์ถ๋ฆฌ๋ฅผ ScriptableObject ๋ด auto_cacl ๋ณ์๋ฅผ ์ค์ ํด์ฃผ๋ ๊ฒ์ผ๋ก ๊ธฐ๋กํด์ค์ ์๋ค. ๋ํ ์ด๋ฌํ ์ ๋ณด Note๋ฅผ ์๊ฐํํ๋ ๊ฒ์ ๋ด๋ถ Information_update Script๋ฅผ ํธ์ถํ๋ ๊ฒ์ผ๋ก ๊ฐ๋ฅํ๋ฐ ํด๋น Script์์๋ ๋ค์๊ณผ ๊ฐ์ ์ฝ๋๊ฐ ์กด์ฌํ๋ค.
20 public void set_information_computer(int index, information value) // Computer๊ฐ ์ค์ ํ ์ ๋ณด๊ฐ์ ๋ฐ์ (Sprite ๋ณ๊ฒฝ)
{
computer_informations[index] = value;
switch (value)
{
case information.none:
computer_information_image[index].sprite = none;
break;
case information.wondering:
computer_information_image[index].sprite = wondering;
break;
case information.not_this:
computer_information_image[index].sprite = not_this_one;
break;
case information.this_one:
computer_information_image[index].sprite = this_one;
break;
}
}
ํด๋น ์ฝ๋์์ computer_information_image๋ ๊ฐ ScriptableObject์ ๋ํ ์ถ๋ฆฌ ์ ๋ณด๋ฅผ ์ด๋ฏธ์ง๋ก ํ์ํ ์ ์๋๋ก ์ฐ๊ฒฐ๋์์ผ๋ฉฐ, ์ set_information_computer ํจ์๋ฅผ ํตํด ํน์ index ์ด๋ฏธ์ง๋ฅผ ๋ณ๊ฒฝํ๋ ๊ฒ์ด ๊ฐ๋ฅํด์ง๋ค. Information_list Script ๋ด init_information, zero_match, more_match ํจ์์์ ์ด๋ฅผ ํธ์ถ, ๊ฐฑ์ ๋ ์ถ๋ฆฌ ์ ๋ณด๋ฅผ ์๊ฐํํ๋ค.
์ด๋ฌํ ๋ฐฉ์์ ์์คํ ์ด ๊ณ์ฐํ ์ถ๋ฆฌ ๊ฒฐ๊ณผ๋ง์ ๋ฐ์ํ๊ณ ์์ผ๋ฉฐ, ํ๋ ์ด์ด๋ ์ด๊ฒ๋ง์ ์ด์ฉํด์ ์๊ฑฐ๋ฒ์ ์งํํ๊ธฐ๋ ํ๋ค๋ค. ๋ฐ๋ผ์ Information_Update Script ๋ด ํ๋ ์ด์ด์ ์ ๋ณด๋ฅผ ๋ฐ์ํ ์ ์๋ Child_information_Update Script๋ฅผ List ํํ๋ก ์ฐธ์กฐํด์ฃผ๋๋กํ๋ค.
Child_information_Update Script๋ Unity EventSystem์ ์ด์ฉํด ์ด๋ฏธ์ง ํด๋ฆญ์ด ๊ฐ์ง๋๋ฉด ์ ๋ณด๋ฅผ ๋ณ๊ฒฝํ๋ ๊ธฐ๋ฅ์ ๊ฐ์ง๊ณ ์๋๋ฐ ํ๋ ์ด์ด๋ ์ด๋ฅผ ์ด์ฉํด ์ ๋ณด๋ฅผ ์์ ์ด ์ํ๋ ๋ฐฉํฅ์ผ๋ก ๋ณ๊ฒฝํ์ฌ ์๊ฑฐ๋ฒ์ ์งํํ ์ ์๋ค.
Game์์๋ ์ ๋ณดNote์ ์ ๊ทผํ๋ Page์ธ์๋ ์ต์ข ์ถ๋ฆฌ์ ์์ด์ ์ง๊ธ๊น์ง ๊ธฐ๋กํ ์ ๋ณด ์ผ๋ถ๋ฅผ ํ๋ ์ด์ด๊ฐ ๋ณผ ์ ์๋๋ก ์ ๊ณตํด์ฃผ์ด์ผ ํ๋ค. ๊ทธ๋ฌ๋ ์ด๋ฅผ ์ํด ์๋ก์ด ๊ฒ์์ค๋ธ์ ํธ๋ฅผ ๋ง๋๋ ๊ฒ์ ์ฑ๋ฅ์ ๋ ์ก์๋จน์ ๋ฟ๋๋ฌ ์ ๋ณด๋ฅผ ๊ธฐ๋กํ๋ ๊ด๋ฆฌ ๋ถ๋ถ์์๋ ํจ์ฌ ๋นํจ์จ์ ์ด๋ค. ์ด๋ฅผ Information_List Script๋ ์๋ ํจ์๋ฅผ ํตํด Animator๋ฅผ ํธ์ถํ๋ ๋ฐฉ์์ผ๋ก ์ฒ๋ฆฌํ๊ณ ์๋ค.
209 public void set_visualize(bool value) // ์ ๋ณด Note๋ฅผ Animator๋ฅผ ์ด์ฉํด ๋ณด์ผ์ง ์๋ณด์ผ์ง ์ค์
{
if(animator!=null)
{
animator.SetBool("Visualize", value);
}
}
public void start_animation(string value) // value ์ด๋ฆ์ ๊ฐ์ง ์ ๋๋ฉ์ด์
์ Animator์์ ์ฌ์
{
if(animator!=null)
{
animator.Play(value, -1, 0.0f);
}
}
์ด ํจ์๋ GameManager Script์๋ ์ฐ๊ฒฐ๋์ด ์์ผ๋ฉฐ ํ์ด์ง๊ฐ ์ด๋๋ ๋ ์ ๋ณดNote๊ฐ ๋ณด์ฌ์ผ ํ๋ ์๊ฐ์๋ GameManager ๋ด set_visualize ํจ์๋ฅผ ์๋ก Open๋๋ ํ์ด์ง๊ฐ ํธ์ถํ๋ฉฐ, ์ผ๋ถ ์ ๋ณด๋ง ๋ณด์ฌ์ผ ํ๋ ์๊ฐ์๋ GameManager ๋ด information_animation_start ํจ์๋ฅผ ํธ์ถํ๋ ๊ฒ์ผ๋ก ๊ตฌํํ ์ ์๋ค.
์ด๋ฅผ ํตํด ์๋์ ๊ฐ์ด ํ์ด์ง ์์น์ ๋ฐ๋ผ ์ ๋ณด Note์ ํน์ ๋ถ๋ถ์ ์ถ๋ ฅํ๋ ๊ฒ์ด ๊ฐ๋ฅํ๋ค.
๊ธฐ๋ณธ์ ์ผ๋ก ButtonCommandObject๋ฅผ ์์๋ฐ์ Script๋ค์ ๋ชจ๋ ๊ฒ์ ์งํ์ ์์ด์ ์ฌ์ฉ์ด ๋๋ฉฐ, ์ด๋ฌํ ์งํ์ ๋ชจ๋ ํ์ด์ง ์ด๋์ ์๋ฐํ๊ณ ์๋ค. ๋ฐ๋ผ์ ์ด์ ํ์ด์ง๋ฅผ ๋นํ์ฑํํ๊ณ ์ ํ์ด์ง๋ฅผ ํ์ฑํํ๋ ๊ธฐ๋ฅ์ด ํ์ํ๋ฐ ์ด๋ฅผ off_gameobjects, on_gameobjects๋ผ๋ GameObject List์ ์ฐ๊ฒฐํด ์ฌ์ฉํ๊ณ ์๋ค.
๊ทธ๋ฌ๋ ์์๋ฐ์ Script๋ค์ ์ด๋ฌํ ๊ธฐ๋ฅ์ ์ ๋ถ ๋ฐ๋ก ๊ตฌํํ์๋๋ฐ ์ด๋ฅผ ์ํ Script๋ฅผ ํ๋ ๋ ์์ฑํ๊ณ ์ด๋ฅผ ์์๋ฐ์ ์์ฑํ์ผ๋ฉด ์ค๋ณต๋ ๊ธฐ๋ฅ์ ๋งค Script๋ง๋ค ์์ฑํ๋ ์ผ์ ์๊ธฐ์ง ์์์ ๊ฒ์ด๋ค.