[스파르타코딩클럽] 게임개발 종합반 - 5주차

[수업 목표]

  1. 런칭을 위해 필요한 주변 기술 학습
  2. 소리넣기, 광고, 출시까지 직접 경험하기
  3. 만들 수 있는 게임의 범위 알기

[목차]


01. 오늘 배울 것

  • 1) 5주차 수업의 목표와 범위

    • 이번주는 편하게 따라하시면 되는 것이랍니다.

    • 런칭을 하려면 준비해야 할 몇 가지를 더 다뤄볼게요!

      → 게임에 음악 입히기

      → 스플래시 화면 붙이기

      → 광고 붙이기

      → 무료 에셋 구경하기

    • 오늘은 머리 아픈 것 없습니다! 찬찬히 따라하면 끝~! 😎

  • 2) 오늘 만들 것

  • 3) 4주차 르탄이 카드 뒤집기 게임 작동 확인하기

    → 잘 작동하네요! 이제, 시작합니다!

    Untitled

02. 시작화면 만들기

  • 1) 시작씬을 만들어봅니다.

    1. Scenes 폴더 → StartScene 만들기

      Untitled

    2. 화면 색 바꾸기

      1. 카메라 색 : rgb ⇒ 90, 90, 225으로 설정 해줍니다.

        Untitled

    3. 이미지 넣기

      1. 오른쪽 클릭 - > UI → Image 클릭 → 이름은 rtans라고 지정해 줍니다.

      2. 크기는 width: 400, height: 400으로 설정 합니다.

        Untitled

    4. 타이틀 만들기

      • [코드스니펫] 폰트 다운로드

          [https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/game_new/week04/BMHANNA_11yrs_ttf.ttf](https://s3.ap-northeast-2.amazonaws.com/materials.spartacodingclub.kr/game_new/week04/BMHANNA_11yrs_ttf.ttf)

        BMHANNA_11yrs_ttf.ttf

      1. Assets → fonts 폴더 생성 → 폰트 파일 넣어줍니다.

      2. font-size: 70, y: 350으로 설정 해줍니다.

      3. width: 760, height: 200으로 설정 해줍니다.

      4. text에 르탄이를 찾아라 라고 적어 줍니다.

      5. 폰트를 적용 해주고, 폰트 사이즈는 70으로 적용시켜 줍니다.

      6. 가운데 정렬로 맞춰줍니다.

      7. color: (255, 255, 255, 255)로, 컬러는 흰색을 맞춰 줍니다.

        Untitled

    5. 버튼 만들기

      1. Canvas → 오른쪽 클릭 → UI → Image 만들어서

      2. 이름은 startBtn로 변경

      3. 사이즈와 위치는 width: 360, height: 120, PosY: -400 로 적용해 줍니다.

      4. add component → shadow 컴포넌트 추가

      5. distance는 x: 10, y: -10, 색 (color)은 250, 250, 0 , 200로 설정 해줍니다.

      6. Title 복사( ctrl+d )해서 startBtn 아래에 두기.

      7. PosY: 0, width: 360, height: 120, color: (0, 0, 0, 255)로 설정 해줍니다.

        Untitled

  • 2) 르탄이 이미지 애니메이션 넣기

    1. Animations 폴더 → rtans 만들기 → rtans 이미지에 붙이기

      Untitled

    2. 애니메이션 만들기

      → 애니메이션 더블클릭하고, 르탄이 이미지 전체(0~7)를 끌어다놓기

      → 오른쪽 바를 끌어서 40에 맞추기. 르탄이가 빠르게 회전하는 것을 확인!

      Untitled

  • 3) startBtn 에 기능 만들기

    1. startBtn.cs 만들기

       using UnityEngine.SceneManagement;
      
       public void startGame()
       {
           SceneManager.LoadScene("MainScene");
       }
    2. 버튼 컴포넌트 만들고 클릭 붙이기

      Untitled

    3. 잘 되는지 확인하기

      → 완료! 이제 시작해볼까요?

      Untitled

03. 스플래시 이미지 만들기

  • 1) 스플래시 이미지란?

    • 예) 카카오톡 시작할 때 뜨는 이미지 같은 것이랍니다.

      Untitled

    • 이 씬은 우리가 만드는 게 아니라, 유니티에서 몇 가지 세팅만으로 만들 수가 있어요.

      → 즉, Scene 만들어 SceneManager.Loadscene.. 하는 게 아닙니다. 😉

    • 다만! 무료버전에서는 유니티 로고가 함께 노출된답니다.

      → 아쉽게도 로고를 지우려면 Pro 버전을 구매해야..

      → 한편, made with Unity 라고 쓰여진 게임들은 모두 무료버전의 유니티로 제작했음을 우리도 알 수 있겠죠! 자, 그럼 직접 세팅해볼까요?

  • 2) 이미지 세팅하기

    1. Edit → Project settings → Player → Splash Image로 접근하기

      Untitled

    2. Preview를 눌러 확인하기

      → Splash Style : 배경 / 로고 색

      → Animation : Dolly - 잠깐 커짐 / Static - 일정 크기

      Untitled

    3. Images 폴더에 로고 준비하기

    → Mesh Type : Full Rect ⇒ Apply 클릭

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e8396268-b03d-47a3-946e-d62074c3fc89/Untitled.png)

4. 스플래시 화면 세팅하기

    → Animation : Static 으로 맞추기

    → Draw Mode : All Sequential 로 맞추기

    → 이미지 : select → spartaMsg 클릭

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b10603a3-0039-4afd-8dcf-ce3c35c2c45a/Untitled.png)

5. preview 눌러서 확인하기

    → 잘 되네요!

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6bd7db93-b51d-4669-817e-f171f56fd666/Untitled.png)

04. 소리 & 배경음악 넣기

  • 1) 사운드 구상하기

    1. 배경음악 : 게임이 시작하면 배경음악이 나오면 좋겠어요!
    2. 뒤집을 때 : 카드 뒤집을 때 뒤집는 소리가 나면 좋겠죠!
    3. 맞췄을 때 : 카드 두 장이 같을 때 소리가 나면 좋겠죠!
  • 2) 음원 준비하기

    1. 다운받아서 적당한 폴더에 풀고 → 파일을 들어봅니다.

    2. Unity에 Sounds 폴더를 만들고 가져다놓기

      Untitled

  • 3) 소리 재생하기: 카드 뒤집기

    1. cardAudioSource 컴포넌트 달기

      Untitled

    2. card.cs 준비하기

      → AudioClip, AudioSource 받기

       public AudioClip flip;
       public AudioSource audioSource;

      Untitled

    3. 적절한 순간에 재생되게 하기

      → flip을 한번만 재생되게 하기

       public void openCard()
       {
           audioSource.PlayOneShot(flip);
      
           anim.SetBool("isOpen", true);
           transform.Find("front").gameObject.SetActive(true);
           transform.Find("back").gameObject.SetActive(false);
      
           if (gameManager.I.firstCard == null)
           {
               gameManager.I.firstCard = gameObject;
           }
           else
           {
               gameManager.I.secondCard = gameObject;
               gameManager.I.isMatched();
           }
       }
  • 4) 소리 재생하기: 카드 맞췄을 때

    1. gameManager.cs 에서 같게 세팅하기

      → AudioSource 컴포넌트 붙이고

      → AudioSource, AudioClip 받고

       public AudioSource audioSource;
       public AudioClip match;

      Untitled

    2. 재생하기

       public void isMatched()
       {
           string firstCardImage = firstCard.transform.Find("front").GetComponent<SpriteRenderer>().sprite.name;
           string secondCardImage = secondCard.transform.Find("front").GetComponent<SpriteRenderer>().sprite.name;
      
           if (firstCardImage == secondCardImage)
           {
               audioSource.PlayOneShot(match);
      
               firstCard.GetComponent<card>().destroyCard();
               secondCard.GetComponent<card>().destroyCard();
      
               int cardsLeft = GameObject.Find("cards").transform.childCount;
               if (cardsLeft == 2)
               {
                   endTxt.SetActive(true);
                   Time.timeScale = 0.0f;
               }
           }
           else
           {
               firstCard.GetComponent<card>().closeCard();
               secondCard.GetComponent<card>().closeCard();
           }
      
           firstCard = null;
           secondCard = null;
       }
  • 5) 조금 특별하게 - audioManager 만들기

    1. gameManager처럼, audioManager를 만들어 줍니다.

      → 스크립트도 audioManager.cs 를 만들어 붙여주세요!

      Untitled

    2. AudioSource 컴포넌트를 붙이고, 준비합니다.

       public AudioSource audioSource;
       public AudioClip bgmusic;

      Untitled

    3. Start() 에서 실행해줍니다.

      → 이번엔 계속 실행될 예정이니, 아래 두 줄을 넣어주세요!

       audioSource.clip = bgmusic;
       audioSource.Play();

05. 빌드하기

  • 1) 마켓에 올리기 전 확인해야 하는 설정들

    • EditPreferenceExternal Tools 체크

      • Android 빌드를 위해서는 JDK, NDK, SDK 설정이 필수

        → Unity Hub에서 1주차에 설치시 함께 완료했습니다!

        • 만약 설치하지 않았다면?

          → Unity Hub 를 통해서 추가 설치가 가능합니다.

          https://s3-us-west-2.amazonaws.com/secure.notion-static.com/44ea4f0c-df2f-4cb6-aca5-16e844e2162f/Untitled.png

          https://s3-us-west-2.amazonaws.com/secure.notion-static.com/55c2489d-9403-4255-a2f0-2d55ef4887d1/Untitled.png

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/040f86ea-7f52-4eb0-8246-abac147403e2/Untitled.png)

- `Edit` → `Project Settings` → `Player`
    - Company Name 과 Product Name, 그리고 Version 을 적절히 입력해주세요

        → Company Name : `SpartaCodingClub`

        → Product Name : `findRtan`

        → Version : `1.0`


    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a869b62f-360f-4d94-81a7-9dc081c8d1fd/Untitled.png)

- Icon
    - Select아이콘을 누르고 spartaMsg를 선택.
- Resolution and Presentation
    - 안드로이드로 바꾸고, Landscape Right, Left를 꺼줍니다. (우리는 세로형 게임!)

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a464db26-3bfb-4f7e-b47d-339f98e05d62/Untitled.png)

- Other Settings

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/94bb555c-663b-4a1f-93ff-04dc2173df80/Untitled.png)

    - 안드로이드 마켓에 배포하려면 64 bit 지원이 필수가 되었기 때문에 Scripting Backend 를 IL2CPP 로 변경합니다
    - Target Architectures 에서 ARM64 를 체크하도록 합니다.
- Publishing Settings

    <aside>
    💡 Keystore란? 안드로이드에서 이 앱을 배포할 수 있는 권리!

    </aside>

    1. `Keystore Manager` 눌러서 만들기

        ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f2d9ddf3-c84b-43a2-9a0d-83b737d301f6/Untitled.png)

    2. Keystore → Create New → Anywhere 클릭

        → `spartakey` 로 바탕화면에 저장해주세요

        ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1309b92a-3604-44b0-a683-f86d890844aa/Untitled.png)

    3. 그 외 입력하기

        → Alias : `spartakey`

        → Password : `123456` (간단하게 설정해주세요)

        → Add Key 클릭!

        ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/89834ffa-9f34-4d09-8c6b-1527a294d72e/Untitled.png)

    4. `Yes` 를 클릭

        ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2d783adf-1ab1-41a5-933d-45b4e9e6347a/Untitled.png)
  • 2) 원하는 OS 대상으로 Switch Platform 하고 빌드하기

    1. Build Settings 항목 클릭

      Untitled

    2. Scenes in Build에 씬 추가하기

      Untitled

    3. Switch Platform 눌러주기 (한참 시간이 걸립니다)

      Untitled

    4. 다시 화면 사이즈를 정해주고

      Untitled

    5. 다시, 우측 하단 Build를 눌러서 빌드해보기 (한참 시간이 걸립니다!)

      → apk 파일 이름은 myFirstGame 으로 할게요!

      Untitled

      → 아래와 같이 파일이 생성되면 완료!

      Untitled

    • [참고] 빌드시 Can not sign the application 오류가 뜨는 경우!

      Untitled

      keystore의 비밀번호를 틀린 경우이니 keystore의 비밀번호를 다시 확인해주세요!

  • 3) 배포하려면

    • (1) 안드로이드 폰이 있다면 → 바로 볼 수 있어요!

      • 컴퓨터에 폰을 usb로 연결하고 → 개발자 옵션 → USB디버깅을 켜주기!

        Untitled

      • target device 를 설정하고 → build and run 을 누르면 끝!

        Untitled

    • (2) 방금 만든 .apk 파일을 "구글플레이스토어"나, "애플 앱스토어"에 올리면 되는 것!

      • 구글플레이에는 → 누구나 올릴 수 있습니다!

        → 참고: $25 (1회)의 개발자 등록 비를 내야 한답니다.

      • 애플 앱스토어에 올리려면 → Mac PC가 있어야 해요!

        → 참고: 1년 129,000원의 개발자 등록비를 내야 한답니다.

        • 참고자료

          • 1) 애플 개발자 등록

            • 애플 개발자 사이트에 들어가서 계정을 생성 및 라이센스를 구매합니다

              • 애플 개발자 센터

                https://s3-us-west-2.amazonaws.com/secure.notion-static.com/56b9b3cf-5c2c-4f78-9dd6-58cb81110f13/Untitled.png

              • 하단의 Join the Apple Developer Program을 눌러 개발자 라이센스 구매절차를 따릅니다

                https://s3-us-west-2.amazonaws.com/secure.notion-static.com/78b18d54-253e-45aa-aaef-8e02bb07a5bc/Untitled.png

                https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0322a804-dea0-4297-92a0-0733b61e3dc6/Untitled.png

              • 개인을 눌러주세요( 혹시 회사나 단체면 그에 맞는 것을 눌러주세요

                https://s3-us-west-2.amazonaws.com/secure.notion-static.com/361a0cbb-b1a2-4d03-be70-8a32fc63ab05/Untitled.png

                https://s3-us-west-2.amazonaws.com/secure.notion-static.com/eb9acf80-b0f1-455a-9294-3b10724f3408/Untitled.png

          • 2) iOS 빌드

              expo build:ios
            • 우린 배포를 할거니 아카이브를 선택합니다. 그리고 애플 계정을 만들고, 개발자 라이센스도 구매하였다면! 여기서 Y를 누릅니다

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e58bac47-0433-4a09-ae9f-2e0b6ad31d1c/Untitled.png

            • 다음과 같이 계정을 입력하면, 추가 인증을 할 수도 있습니다. 자동으로 맥에서 추가인증 코드가 뜨거나 문자로 받아 6자리 숫자를 알려주니, 이걸 그대로 터미널에 입력 후 엔터!

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fd88cc8b-c31d-4b05-89c9-9a998c46d91f/Untitled.png

            • 그러면 다음과 같이 인증키(안드로이드에서의 싸인키 정도의 의미)를 여러분들이 직접 추가할지, 엑스포가 알아서 하게 할지 결정하라고 합니다. 엑스포에게 맡겨줍니다.

            • 혹시 기존에 앱을 만들었던 적이 있으면 다음과 같이 기존 키를 사용할것인가? 라고 선택하는 문구를 볼수도 있는데, 이땐 새로 추가를 하시면 됩니다. 그럼 방금 전의 화면처럼 새로 만들 키를 엑스포가 알아서 만들어 추가하게 할지 말지를 결정하는 화면을 보게됩니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0da73def-bb73-4374-874b-736f7d8d53b0/Untitled.png

            • 키생성을 엑스포에 위임했다면 엑스포가 추후에 앱에서 사용할 수도 있는 노티피케이션(푸시 알람) 기능을 위한 푸시 키까지 생성을 도와줍니다. 이것 또한 엑스포가 알아서 생성하고 처리할 수 있게 위임합니다. 이것 또한 기존에 만들었던게 있으면 다음과 같이 n을 누르고 엑스포에 위임한다!를 선택하시면 됩니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6860ec1f-efab-495a-8a86-45246c08e703/Untitled.png

            • 프로비져닝도 엑스포에 위임

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8a51641e-74f4-473c-b5d8-d2a4f4594237/Untitled.png

            • 이 모든 과정이 끝나면 빌드 단계에 들어갑니다. ipa 파일을 생성하고 있는 겁니다. 그럼 끝다길 기다립니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d80f1615-191a-48ec-9fc4-f63adae8ff91/Untitled.png

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c30a71dd-7db5-4190-ad86-70c67fd55eaf/Untitled.png

            • 빌드가 완료됐다!라는 터미널 화면을 보게되면 엑스포 대시보드에 로그인하여 artifact 파일을 내려봤습니다. 쉽게 말해 앱 파일입니다. 그럼 드디어 우린 ipa 앱 파일을 다운 받게됩니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/39ce4437-73a0-421d-8cd4-d80163f77a54/Untitled.png

          • 3) 앱스토어에서 개발중인 앱 선택 및 작업 공간 활성화

            https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6b4fb6ee-d2d5-4546-8e1e-f276e652a711/Untitled.png

            https://s3-us-west-2.amazonaws.com/secure.notion-static.com/27c01740-7e61-413b-9c97-434253e3da71/Untitled.png

            https://s3-us-west-2.amazonaws.com/secure.notion-static.com/760afeaa-46d0-47af-b0c5-8ea8518c93be/Untitled.png

            • 플랫폼은 iOS

            • 이름은 여러분이 원하는데로!

            • 기본언어는 한국어!

            • 번들 ID는 여러분들이 방금 엑스포에서 빌드(배포)단계를 거쳤다면 표시가 나옵니다. 그걸 누르세요!

            • SKU는 유니크한 앱 아이디를 쓰면 되는데, app.json 에 썼던 "bundleIdentifier": "com.sparta.psytest", 의 값을 넣어주세요. com.sparta.psytest 이거요!

            • 그리고 전체 엑세스!

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6a68eb77-f188-42e9-846a-eaff49df14bb/Untitled.png

          • 4) 트랜스포터로 앱 파일을 앱스토어로 전송

            https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8f331f9b-966a-4490-b5f8-61bbfaf6fb24/Untitled.png

            https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9e09a4ea-cec8-44b1-9d51-a1ddf1e370f8/Untitled.png

            • 앱 스토어에서 해당 프로그램을 다운받고 실행합니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/618fdaee-7671-4149-ae8c-8285982bae5f/Untitled.png

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3d1dbfc1-079f-4361-88a7-f75161d61d7d/Untitled.png

            • Expo 대시보드에서 내려받은 ipa 파일(대시보드 상에서 보았던 artifact 파일)을 선택하고 전송을 누릅니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3193ca0f-0447-4b29-b51d-efcca65eee15/Untitled.png

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/50b5de6a-7c63-4e05-a899-1188f1f794a0/Untitled.png

            • 전송이 완료되면, 앱 스토어 관리자 페이지 활동 내역에서 처리중인것을 확인이 가능합니다. 좀 기다리면 처리중에서 사용 가능한 단계로 바뀝니다.

            • 우리가 안드로이드 배포때 만든 앱로고도 보이죠?

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/777ceb44-4691-4e24-a3d9-749b5f5cfda7/Untitled.png

          • 5) 이미지 및 최종 정보 등록 후 승인 요청

            • 그럼 실제 사용 단계 전까지 기다리는 동안 나머지 이미지들과 정보를 기입합니다.

            • 이미지는 권고사항을 그대로 따라야 합니다. (권고 사항 보기)

            • 이 또한 온라인 포토샵 또는 디자인 툴로 준비를 해서 차근차근 업로드를 합니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8e7761cf-31c2-48c4-977f-74d112207a50/Untitled.png

            • 프로모션, 설명, 키워드는 앱 관련해서 적고 싶은 정보를 기입하고, 지원 URL, 마케팅 URL은 일단! 스파르타코딩 클럽 홈페이지 주소로 넣습니다. 혹시 심사가 이것때문에 통과되지 않는다면 관련 홈페이지를 간단하게 준비하셔야해요!

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f7e7c4f2-ab1e-4122-97e0-56f4573d446e/Untitled.png

            • 앱클립, iMessage, Apple Watch 모두 넘어갑니다. 우립 앱을 만들고 있으니까요. 그리고 빌드 파일 선택은 위에서 우리가 트랜스포터로 전송 시킨 앱이 처리중에서 사용가능 단계가 되면 선택을 할 수 있게 됩니다. 일단 넘어갑니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c91341a4-b972-4103-8cfb-4617dbe13508/Untitled.png

            • 다음 정보에선 등급만 설정합니다.

            • 저희 앱은 전부 아니오를 체크하면 됩니다. 해당사항이 없습니다 😂

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4c6fc260-3d12-4955-a05a-e1a91ffa7136/Untitled.png

            • 앱 심사 정보는 앱이 제대로 통과가 안되면, 안된 사유를 알려주기 위해 혹은 커뮤니케이션 할 사람의 정보를 기입하면됩니다.

            • 유의할점은 전화번호 형식은+8210~과 같이 국가 번호를 입력해야합니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b5f69d0a-c443-4696-908b-15394ac9c3b2/Untitled.png

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ab8d92cf-f743-4ab4-b51e-4edbdf48736d/Untitled.png

            • 이번 절차 또는 추후(앱 재배포)에 앱 심사를 거친다음 앱을 본인이 직접 버튼을 눌러 앱 스토어에 제출할건지 아니면 자동으로 제출하게 할건지 결정합니다.

            • 광고 식별자는 우리에게 해당사항이 없으므로 아니요!

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e409446a-884a-4191-aa14-48274c9994ce/Untitled.png

            • 그리고 저장을 누릅니다

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/82239bb9-7a70-4af4-8284-a8c0a2fba6d0/Untitled.png

            • 저장을 눌렀으면 왼쪽에 앱 정보를 누릅니다.

            • 개인정보 처리방침 URL은 스파르타코딩 클럽 홈페이지 주소를 넣습니다.
              ( 사실 이렇게하면 결과적으로 앱 심사를 통과할 수 없습니다. iOS 앱 심사는 정말 까다롭기 때문에, 실체적이고 유효한 값들을 넣어야 하는데, 일단 그 과정만 같이 하는 것에 의의를 두고 추후에 앱을 정말 배포 하실땐 관련 정보를 제대로 준비하셔야 합니다.)

              깃허브 리파짓 토리를 파고 다음 사례처럼 README.md 에 작성하여 URL로 사용할 수 있습니다.
              (사례)

            • 부재도 적당히 기입해줍니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/917f9831-1dcc-4539-ba3b-8ca120f65bc7/Untitled.png

            • 카테고리도 앱 성격에 맞게 선택해주시고, 콘텐츠 권한도 심리테스트 앱에서 타사 콘텐츠에 엑세스 안함을 선택해줍니다.

            • 그리고 저장!

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d8205872-a42a-4bc8-a080-2545d79cb599/Untitled.png

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b2f35112-4f1f-4ca5-a762-91061e886700/Untitled.png

            • 왼쪽의 가격 및 사용 가능 여부를 선택한다음 무료를 선택해주세요

            • 그리고 저장!

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/625c0b94-742f-4f2f-b393-3a7e763cb54d/Untitled.png

            • 자 이제 상단의 App Store 탭을 누르면 우리가 초반에 작성했던 페이지를 보게됩니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9e6aeb60-85a8-42fc-a30a-7c9d7c52502a/Untitled.png

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/33e7b0d0-cd6e-4bab-b338-736fa635bc9b/Untitled.png

            • 암호화를 사용하고 있지 않음을 눌러줍니다

            • 그 다음 마지막으로 우측 상단에 심사를 위해 제출을 누릅니다

            • 그러면 왼쪽에 심사 대기중을 보게 됩니다.

              https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c9917bfe-9fe6-4fad-badc-077158b7069a/Untitled.png

06. 광고 붙이기

[준비하기]

  • 1) Unity Ads 란?

    • 기존에도 광고를 붙일 수 있는 방법은 많았으나, Unity 에서 직접 지원하는 이 방법을 통해 코딩을 잘 몰라도 손쉽게 광고를 붙이고 관리할 수 있게 되었습니다!
    • 이 밖에 google ads 등이 있지만, 게임을 만들 때에는 Unity Ads가 무척 편하답니다.
  • 2) Unity 에디터 내에서 Unity Ads 추가하기

    1. WindowsGeneralServices 탭을 클릭하여 Service 메뉴 보기

      → General Settings 클릭

      Untitled

    2. organizations 드롭다운 해서 선택 → Create Project ID 클릭

      Untitled

    3. Ads의 off 클릭

      Untitled

    4. 패키지 매니저 사용하기

      • [참고] 추가 설치를 왜 진행 하나요?

        유니티 업데이트로 기본 Advertisement 설치시 4.4.1 버전이 설치됩니다.

        이 버전으로 설치하시고 진행하시면 오류가 발생하니

        강의 영상과 동일한 3.7.5 버전의 패키지 설치를 위해 패키지 매니저를 사용합니다!

    1) 14세 이하 ... **No**

    2) Window → Package Manager로 패키지 매니저 열고 Packages: Unity Registry 클릭합니다.

    ![unity registry.jpg](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8f21317e-2e20-474c-986d-bc69be5f3c3b/unity_registry.jpg)

    3) Advertisement install 클릭합니다 ( 3.7.5 버전인지 꼭 확인! )

    ![advertisement1.jpg](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2b8f9f85-1350-47b4-9f6a-b22cbd945de9/advertisement1.jpg)

    4) Service로 돌아와서 **off** 를 **on** 으로 변경 합니다.

    5) **on** 이라고 뜨면 일단 준비 끝납니다.

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dacd38c9-8bc1-4224-8569-70b4d76eeff3/Untitled.png)

    → 강의 영상과 달리 **Install Lastest Version** 은 클릭하실 필요 없습니다!

    6) Test mode 체크하기!

    ![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0d642823-e5ee-484f-893e-282a6b436997/Untitled.png)

    7) Ads Package 클릭 → **Install Lastest Version** 해주기

[게임 끝나면 붙이기]

  • 1) adsManager 준비하기

    1. adsManager 만들기

      • 단, 이번엔 꽤 작업할 것이 많아서, 붙여놓고 살펴볼게요!

      • adsManager를 만들고, adsManager.cs 를 붙여줍니다.

        → 아래를 먼저 추가하고, 코드스니펫 추가!

          using UnityEngine.Advertisements;
        • [코드스니펫] adManager.cs 코드

            public static adsManager I;
          
            string adType;
            string gameId;
            void Awake()
            {
                I = this;
          
                if (Application.platform == RuntimePlatform.IPhonePlayer)
                {
                    adType = "Rewarded_iOS";
                    gameId = "iOS 아이디";
                }
                else
                {
                    adType = "Rewarded_Android";
                    gameId = "Android 아이디";
                }
          
                Advertisement.Initialize(gameId, true);
            }
          
            public void ShowRewardAd()
            {
                if (Advertisement.IsReady())
                {
                    ShowOptions options = new ShowOptions { resultCallback = ResultAds };
                    Advertisement.Show(adType, options);
                }
            }
          
            void ResultAds(ShowResult result)
            {
                switch (result)
                {
                    case ShowResult.Failed:
                        Debug.LogError("광고 보기에 실패했습니다.");
                        break;
                    case ShowResult.Skipped:
                        Debug.Log("광고를 스킵했습니다.");
                        break;
                    case ShowResult.Finished:
                        // 광고 보기 보상 기능 
                        Debug.Log("광고 보기를 완료했습니다.");
                        break;
                }
            }
    2. 몇가지 세팅하기

      • Start()Update() 는 지워주세요.

      • iOS 아이디, Android 아이디 부분에 내 아이디 (숫자)를 적으세요

        → 어디있냐고요?

        → Window → General → Services → Ads 클릭 → 아랫쪽에!

        Untitled

    3. 광고 활성화 시켜주기

      1. Dashboard를 누르고 로그인 합니다.

        Untitled

        b. Get Started 를 누르고 활성화를 시켜줍니다.

        unity monetization_1.jpg

        c. Project Setup 으로 진행 합니다.

        ads.jpg

        ads1_.jpg

        ads2_.jpg

        d. 완료하면 아래 화면에서 ID를 확인할 수 있습니다 😎

        ad fin.jpg

        e. Finish setup 이후에는 Ad Units에서 확인하실 수 있습니다.

        ad_unit.jpg

  • 2) 텍스트를 눌렀을 때 광고 뜨게 하기

    1. gameManager.cs 에서 30초 → 3초에 끝나게 하기 😁

       if (time > 3.0f)
       {
           endTxt.SetActive(true);
           Time.timeScale = 0.0f;
       }
    2. endTxt.cs 에서 넘어가던 씬을 gameManager.cs 의 함수로 만들기

      → 우선, 따라해볼게요!

       using UnityEngine.SceneManagement;
      
       public void retryGame()
       {
           SceneManager.LoadScene("MainScene");
       }
    3. adsManager.cs 에서 보상을 적어두기

       void ResultAds(ShowResult result)
       {
           switch (result)
           {
               case ShowResult.Failed:
                   Debug.LogError("광고 보기에 실패했습니다.");
                   break;
               case ShowResult.Skipped:
                   Debug.Log("광고를 스킵했습니다.");
                   break;
               case ShowResult.Finished:
                   // 광고 보기 보상 기능 
                   gameManager.I.retryGame();
                   break;
           }
       }
    4. endTxt.cs 에서 마지막으로 텍스트가 눌렸을 때 광고를 보게 하기

       public void retryGame()
       {
           adsManager.I.ShowRewardAd();
       }
    5. 텍스트를 눌렀을 때 아래와 같이 나오면 완성!

      Untitled

  • 3) 주의사항

    1. Advertisement.Initialize(gameId, true);

      → 런칭할 때는 여기 true 를 false 로만 바꿔줘야 합니다. (true는 테스트를 하겠다는 뜻)

    2. 여기도 체크 해제해줘야겠죠!

      Untitled

    3. 그리고 다 했으면!

      → 게임 종료 조건 3.0f 를 다시 → 30.0f 로 바꿔둬야겠죠! 😎

07. 게임제작 꿀팁 _ 에셋스토어, next step

[무료 에셋스토어 구경하기]

  • 1) 무료 에셋스토어란?

    • 음악, 배경, 캐릭터, 애니메이션.. 모든 것을 할 수 없겠죠!
    • 그럴 때 이용하는 것이 "무료 에셋스토어"들이랍니다.
    • 사실은 "유료"라고 하더라도 비싼 가격은 아니기에, 실제 1인 개발자들은 틈 날 때마다 이 곳을 들여다보고 괜찮은 것들을 사두기도 한답니다. 할인 이벤트도 자주 해요!
  • 2) 유명한 곳 둘러보기 (1)

    • [코드스니펫] OpenGameArt.org

        https://opengameart.org/
    • UI가 조금 올드해보여도 이만한 데가 없답니다!

    • Browse → 2D Art → CCO 에 클릭하고 다시 검색을 눌러 둘러볼까요?

      [우선 이 정도로만 알아둘게요]

      → CC-BY , GPL , ... ⇒ 사용에 뭔가 조건이 있음

      → CC0 ⇒ 사용에 아무런 조건이 없음

      [사용법]

      → 눌러서 다운로드 받아 사용하면 된답니다.

      Untitled

  • 3) 유명한 곳 둘러보기 (2)

    • [코드스니펫] 유니티에셋스토어

        https://assetstore.unity.com/2d?category=2d&free=true&orderBy=1&rows=264
    • [코드스니펫] 예제 import 해보기

        https://assetstore.unity.com/packages/audio/sound-fx/free-casual-game-sfx-pack-54116
→ `Add to My Assets` 클릭 → Accept 클릭 → Open in Unity 클릭

→ `Download` 클릭 → `Import` 클릭

![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2b87411f-9557-466b-8262-5890203dfae5/Untitled.png)

![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7943cbea-eb76-42aa-8145-04e1d90eda08/Untitled.png)

→ Import 를 클릭하면 폴더가 생긴답니다!

![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/117be35f-6d63-4f1c-907f-c3d87b79b776/Untitled.png)

→ 여기서 쓰고 싶은 것만 남기고 나머지를 삭제하셔도 무방합니다. (또는 다른 곳에 보관!)

![Untitled](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dfe81a5d-1619-444e-83ed-f562464a0906/Untitled.png)
  • 4) 팁 - 사용 방법

    • 배경이미지, 효과음, 배경음악 을 가져다 쓰는 게 좀 더 적당하답니다.
    • 사실 여러분이 오늘 붙인 효과음도 OpenGameArt.org 에서 가져온 것!

[우리가 만들만한 게임의 범위]

  • 1) 되짚어보기 + 더 공부한다면?

    • 1주차: 유니티의 기본 사용법 - 빗물받는르탄이

    • 2주차: 유니티 사용법 복습1 + 데이터저장 - 풍선을 지켜라

    • 3주차: 유니티 사용법 복습2 + 레벨 구현 - 고양이 밥주기

    • 4주차: 퍼즐게임 만들기 & 로직체험 - 르탄이 맞추기

    • 5주차: 소리, 광고

    • 서버에 데이터 저장하기( firebase ), 3D로 카메라를 활용하기


    ⇒ 이것으로 딱 만들만한 것은, 하이퍼캐주얼 게임 !

  • 2) 하이퍼캐주얼 게임이란?

    • 대부분 1) 세로로 플레이, 2) 원 버튼(터치, 슬라이드), 3) 30~60초에 한 판

    • 아래와 같은 게임들 많이 보셨죠!

      Untitled

    • 막간상식) 하이퍼캐주얼 게임으로 굉장히 유명해진 회사들도 많아요!

      → 한 달에 3~4개씩 게임을 만들어, 몇 개가 초 대박을 터뜨리면서 큰! 회사가 됐답니다.

      Voodoo , Ketchapp , Lion studio와 같은 회사들이 있어요!

  • 3) 내가 게임을 기획해본다면?

    • 쫄깃 류 : 아주 간단한데, 콤보가 핵심이라, 10 → 11 → 12콤보 갈 때에 심장이 쫄깃!

      Untitled

      Untitled

    • 통쾌 류 : 다다다다다 없앨 때 느끼는 쾌감

      Untitled

    • 경쟁 류 : 내가 죽나 네가 죽나 해보자! (지금 수준에선 만들기 어려워요!)

      Untitled

    • 콘텐츠 류 : 더 궁금해. 궁금해!

      Untitled

    • 퍼즐 류 : 으으으. 깨고 싶다 깨고 싶어!

      Untitled

08. 숙제 - 게임 둘러보기

  • [코드스니펫] 구글플레이 스토어

      https://play.google.com/store/search?q=ketchapp&c=apps
  • 힌트요정 - 👻

    → 우선 Ketchapp 이라는 회사로 맞춰뒀어요.

    → 여기서부터 출발해서, 유사한 콘텐츠를 타고 돌아다녀보세요!

    Untitled

    예) 제출 링크 예시

      https://play.google.com/store/apps/details?id=com.ketchapp.dunkshot

HW. 5주차 숙제 해설

마음에 드는 게임의 URL을 제출하면 끝!

+ Recent posts