새로운 프로젝트를 만들고 GPGS는 안드로이드만 지원하기 때문에 Build Settings 에서 플랫폼을 안드로이드로 전환
![](https://lycos7560.com/wp-content/uploads/2023/05/image-20.png)
Company Name, Product Name 입력
![](https://lycos7560.com/wp-content/uploads/2023/05/image-24.png)
Other Settings 설정
게임의 식별 유형(Identification)과 구성(Configuration)을 설정
Overrid Default Package Name의 체크를 껐다 키고 패키지 이름의 대문자를 소문자로 바꾸어 준다.
- 소문자로 패키지 이름을 작성하는 것은 네이밍 규칙의 일부이며 (일관성, 가독성)
대소문자를 구분하는 환경에서 파일 또는 리소스를 참조할 때 문제를 피하기 위함 (호환성)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-37.png)
ARMv7, ARM64?
ARMv7과 ARM64는 ARM 아키텍처의 두 가지 서로 다른 버전을 나타냅니다.
ARMv7은 32비트 아키텍처로, 초기 스마트폰과 태블릿 등의 모바일 기기에서 널리 사용되었습니다.
ARMv7 아키텍처는 ARM11과 Cortex-A 시리즈의 프로세서를 포함하며,
상대적으로 낮은 메모리 사용량과 전력 소비로 인해 이전 세대의 기기에서 성능을 향상시켰습니다.
그러나 ARMv7은 주소 공간의 크기에 제한이 있으며, 더 큰 데이터 세트를 처리하는데 제약이 있습니다.반면에, ARM64는 64비트 아키텍처로, ARMv8 아키텍처의 일부입니다.
ARM64 아키텍처는 ARM Cortex-A53, Cortex-A57, Cortex-A72, Cortex-A73 및 Cortex-A75 등의 프로세서에서 사용됩니다.
ARM64 아키텍처는 메모리 주소 공간이 크게 확장되어 32비트 아키텍처에 비해 더 큰 메모리를 처리할 수 있으며,
더 높은 성능과 향상된 보안 기능을 제공합니다.ARM64 아키텍처는 32비트 ARMv7 기반의 응용 프로그램과의 호환성을 유지하면서
새로운 64비트 응용 프로그램을 실행할 수 있도록 설계되었습니다.
이로 인해 ARM64 아키텍처는 과도한 메모리 사용이나 배터리 소모를 줄이면서
기존 애플리케이션과 새로운 애플리케이션의 성능을 균형 있게 지원할 수 있게 되었습니다.요약하자면, ARMv7은 32비트 아키텍처로 과거의 모바일 기기에서 널리 사용되었으며,
ARM64는 64비트 아키텍처로 현재의 모바일 기기에서 사용되며 더 큰 메모리 공간과 향상된 성능을 제공합니다.=> ARMv7은 32비트 ARM64는 64비트 2019년 이후 앱을 배포하기 위해서는 64비트를 지원해야 한다.
많은 디바이스에 대응하기 위해서 둘 다 선택하자.
Publishing 설정
Publishing 하기 위한 설정
![](https://lycos7560.com/wp-content/uploads/2023/05/image-23.png)
Keystore Manager?
- Android 앱을 안전하게 서명하고 원활한 업데이트를 보장하며 앱 배포에 필요 (보안 및 무결성)
잃어버리면 큰일남 (더 이상 업데이트를 진행할 수 없다.)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-25.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-26.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-27.png)
자동으로 입력된다.
패키지 추가
https://github.com/playgameservices/play-games-plugin-for-unity
![](https://lycos7560.com/wp-content/uploads/2023/05/image-28.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-29.png)
v11.01 버전에서 빌드가 안되는 문제가 발생 v10.14으로 변경
![](https://lycos7560.com/wp-content/uploads/2023/05/image-42.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-30.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-32.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-34.png)
임포트가 완료되면 아래의 3가지의 폴더가 생성된다.
ExternalDependencyManager
GooglePlayGames
Plugins
구글 개발자 콘솔에서 API Key를 얻기 위해서 미리 빌드하여 업로드
![](https://lycos7560.com/wp-content/uploads/2023/05/image-36.png)
Google Play Console
https://play.google.com/intl/ko/console/about/
![](https://lycos7560.com/wp-content/uploads/2023/05/image-43.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-38.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-39.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-40.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-41.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-44.png)
Unity Android SDK 수동 업데이트
https://developer.android.com/studio
![](https://lycos7560.com/wp-content/uploads/2023/05/image-45.jpg)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-45.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-46.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-47.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-48.png)
C:\Users\사용자이름\AppData\Local\Android\Sdk\platforms
![](https://lycos7560.com/wp-content/uploads/2023/05/image-49.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-51.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-52.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-53.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-54.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-55.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-57.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-58.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-59.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-60.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-61.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-63.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-64.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-67.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-65.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-68.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-69.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-70.png)
![](https://lycos7560.com/wp-content/uploads/2023/05/image-73.png)
Unity Console 정리
![](https://lycos7560.com/wp-content/uploads/2023/05/image-72.png)
간단한 로그인 로그아웃
GPGSManager.cs
using UnityEngine; using System; using GooglePlayGames; public class GPGSManager : SingletonMonobehaviour<GPGSManager> { private string _ResStr; public EventHandler<EventBoolStrArgs> GPGSAuthenticatedEventHandler; // SighIn 성공 후 이벤트 public EventHandler<EventArgs> GPGSSighOutEventHandler; // SighOut 후 이벤트 private void Start() { // Play Games 플랫폼을 소셜 구현으로 활성화 이 메소드를 호출한 후 소셜에서 메소드를 호출 PlayGamesPlatform.Activate(); GPGSAuthenticatedEventHandler += GPGSAuthenticationEventFunctoin; SignInStart(); } internal void SignInStart() { PlayGamesPlatform.Instance.Authenticate( (_isSuccess, _resStr) => { _ResStr = _resStr; EventBoolStrArgs arg = new(_isSuccess, _ResStr); GPGSAuthenticatedEventHandler?.Invoke(this, arg); }); } public void GPGSSignOut() { PlayGamesPlatform.Instance.SignOut(); EventArgs args = new(); GPGSSighOutEventHandler?.Invoke(this, args); } public void GPGSAuthenticationEventFunctoin(object sender, EventBoolStrArgs e) { // 인증 후 } } public class EventBoolStrArgs : EventArgs { public bool BoolValue; public String ResStr; public EventBoolStrArgs(bool _Bool, String _Str) { BoolValue = _Bool; ResStr = _Str; } }
SingletonMonobehaviour.cs
using System.Collections; using System.Collections.Generic; using UnityEngine; public class SingletonMonobehaviour<T> : MonoBehaviour where T : MonoBehaviour { static T _Instance = null; public static T Instance { get { if (_Instance == null) { //_Instance가 Null일 경우 찾아본다. _Instance = (T)FindObjectOfType(typeof(T)); if (_Instance == null) { var _NewGameObject = new GameObject(typeof(T).ToString()); _Instance = _NewGameObject.AddComponent<T>(); } } return _Instance; } } protected virtual void Awake() { if (_Instance == null) { _Instance = this as T; } DontDestroyOnLoad(gameObject); } }