public void GetCoin(GameObject coin) { currentCoinCount--; // 현재 코인 개수 -1 // 현재 코인의 개수가 바뀔 때마자 UI 출력 정보 갱신 stageUI.UpdateCoinCount(currentCoinCount, maxCoinCount); // 코인 아이템이 사라질 때 호출하는 Item.Exit() 메소드 호출 coin.GetComponent <Item>().Exit(); // 현재 스테이지에 코인 개수가 0이면 if (currentCoinCount == 0) { //게임 클리어 stageController.GameClear(); } }