[Bounce Game] ๐ฅ ๋ฏธ๋๊ฒ์ ๋ง๋ค๊ธฐ 5
1. SingleTon ๊ด๋ จ ๋ฌธ์
์ง๊ธ๊น์ง ์ฝ๋๋ฅผ ์ง ํ ์คํ์ ์ํค๋ฉด ๋ค๋ฅธ Scene์์ ๋ง๋ SingleTon์ ์ธ์ํ์ง ๋ชปํ๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค.
์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํ์ฌ GameManager๋ฅผ ์ฌ์ฉํ๋ Object๋ค์ ๋ค์๊ณผ ๊ฐ์ ์์ ์ ํด์ฃผ์๋ค.
GameManager๋ฅผ ์ง์ ๋ฃ์ด์ฃผ๋ ๊ฒ์ด ์๋๋ผ Script์์ผ๋ก ์์์ ์ฐพ๋ ์์ผ๋ก ์์ ์ ํ์ฌ์ ๋ค๋ฅธ Scene์์ ์จ GameManager๋ผ๋ Tag๊ฐ ๋๊ฐ์ ์ ์ฐพ์ ์ ์๋๋ก ํ์๋ค. ์ดํ ๋ชจ๋ GameManager์ค๋ธ์ ํธ์ Tag๋ก GameManager๋ฅผ ๋ฃ๋๋ค.
public GameObject Game_Manager;
void Start()
{
Game_Manager = GameObject.FindGameObjectWithTag("GameManager");
}
์ดํ ๊ฒ์ ๋์ค์ MainMenu๋ก ๊ฐ๊ธฐ ์ํ์ฌ Player ์คํฌ๋ฆฝํธ์ UI_Manager์ SceneManager.LoadScene("MainMenu"); ์ฝ๋๋ฅผ ๋ฃ์ด์ฃผ๋ฉด ๋๋ค.
2. DB ์ฐ๋ํ๊ธฐ
๊ฐ์ธ ๊ณต๋ถ ๊ธฐ๋ก์ฉ ๋ธ๋ก๊ทธ์
๋๋ค.
ํ๋ฆฌ๊ฑฐ๋ ์ค๋ฅ๊ฐ ์์ ๊ฒฝ์ฐ ์ ๋ณดํด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค.๐