Unity 240

Admob 리워드 광고 로드 실패

Problem 리워드 광고 요청이 안됨 로그 추출 코드 public void Start() { RequestRewardAd(); } private void RequestRewardAd() { Debug.Log("RequestRewardAd"); rewardedAd = new RewardedAd(adUnitId); // Called when an ad request has successfully loaded. rewardedAd.OnAdLoaded += HandleRewardedAdLoaded; rewardedAd.OnAdFailedToLoad += HandleRewardedAdFailedToLoad; rewardedAd.OnAdOpening += HandleRewardedAdOpening; rewarde..

Unity/Unity 이슈 2022.12.26

Unity 구글 로그인 실패 Case #4

Problem Admob, GooglePlayService를 업데이트 하는 과정에서 아래 에러 발생 DllNotFoundException: Unable to load DLL FirebaseCppApp-7_2_0. Tried the load the following dynamic libraries: Unable to load dynamic library FirebaseCppApp-7_2_0 because of Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-7_2_0" not found Solution Firebase(Firestore) 버전 업데이트 전체적으로..

Unity/Unity 이슈 2022.12.23

Unity 구글 로그인 실패 Case #3

Problem 구글 로그인 건드리다가 발생한 에러. APK빌드 후 Phone에 설치 후 실행하면 바로 Crash. Unity로그가 아니라 일반 로그에서 에러발생. (구글검색하면 Unity가 아닌 Android 개발 해결방법이 주로 나와서 헷갈림) Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Solution implementation 'androidx.work:work-runtime:2.7.1' 위 코드 추가 *안되면 force reslove 참고: https://stackoverflow.com/questions/72..

Unity/Unity 이슈 2022.12.23

Unity 구글 로그인 실패 Case #1

Problem 원래 잘 되던 구글로그인이 라이브러리 업데이트 후 먹통이 됨 APK로 빌드 후 Phone에서 실행 시 아래와 같은 로그(Exception에러는 아님) : Returning an error code. : GooglePlayGames.Android.c__DisplayClass18_0:b__0(Int32) : System.Reflection.RuntimeMethodInfo:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) : UnityEngine.AndroidJavaProxy:Invoke(String, Object[]) : UnityEngine._AndroidJNIHelper:InvokeJavaProxyMethod(AndroidJavaPr..

Unity/Unity 이슈 2022.12.23

Addressable 버전 업 이후 제대로 작동을 하지 않는 경우

Problem System.Exception: Unable to load dependent bundle from locationUnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1/c__DisplayClass57_0:b__0 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1)DelegateList`1:Invoke (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.19.19/Runtime/Resou..

Unity/Unity 이슈 2022.11.30

Child Object 삭제 시 유의

https://zimamderotech.tistory.com/89 자식 객체 Destroy 할 때 주의 transform.childCount ------ (1) Destroy(child.gameObject) transform.childCount ------ (2) 위와 같이 자식 객체를 지웠을 때, (1)과 (2) 값은 같다. 화면에서도 지워야 chil.. zimamderotech.tistory.com protected void RemoveAllChild(Transform targetParent) { var children = targetParent.transform.GetComponentsInChildren(true); foreach (var child in children) { if (child ==..

Unity/Unity 이슈 2022.07.11

[RTS Engine] 공격에 반응하지 않게 하기 & 반응 후 처리

다른 짓은 해도 소용없고.. 1. 다른 유닛이 아예 타겟에 잡히지 않도록 하기 1번과정을 해도, 전체적인 AI 시스템에 의해서 유닛전체가 특정 명령을 받게 된다. 2. 복귀 지점 코드 NPCDefenceManager.cs /// /// Sends units back to their creator buildings if it exists, else send them back to their capital building or initial faction start position. /// /// IEnumerable instance of Unit instances to send back. public void SendBackUnits (IEnumerable units) { //go through the u..

Unity/Asset 분석 2022.06.18

[RTS Engine] Object Pooling 이 제대로 안될 때

Effect의 Pooling을 담당하는 부분 EffectObjPool.cs private Dictionary effectObjs = new Dictionary(); //this holds all inactive effect objects of different types. // ... public void AddFreeEffectObj (EffectObj instance) { Queue currentQueue = new Queue(); if (effectObjs.TryGetValue(instance.GetCode(), out currentQueue) == false) //if the queue for this effect object type is not found { effectObjs.Add(inst..

싱글톤 GameObject가 계속 늘어날 때

Problem 싱글톤 오브젝트가 씬 생성시마다 계속 늘어난다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Singleton : MonoBehaviour where T : MonoBehaviour { private static T instance; public static T Instance { get { if(instance == null) { GameObject obj; obj = GameObject.Find(typeof(T).Name); if (obj == null) { obj = new GameObject(typeof(T).Name); instance = obj.AddCompon..

Unity/Unity 이슈 2022.03.27

Unity 웹뷰(WebView) - 흰 화면만 뜨는 경우

https://github.com/gree/unity-webview GitHub - gree/unity-webview Contribute to gree/unity-webview development by creating an account on GitHub. github.com 다운로드 받은 다음 Package를 Import한다. (nofragment는 뭔지 모르겠음) private WebViewObject webViewObject; public void OnClick_Webview() { StartWebView(); } public void StartWebView() { string strUrl = "https://www.naver.com/"; try { webViewObject = (new GameO..

[Addressable] JSON parse error: Invalid value.

Problem ArgumentException: JSON parse error: Invalid value. Bundle사이즈를 체크하는 과정에서 위 에러가 발생. (이 경우는 BOM관련 문제는 아님.) public IEnumerator CheckBundle() { AsyncOperationHandle downloadSize = Addressables.GetDownloadSizeAsync(assetLabel.labelString); yield return downloadSize; if (downloadSize.Result > 0) { DownloadBundle(); } else { LoadLoginScene(); } } Solution TextDataProvider.cs private void Reques..

Unity/Unity 이슈 2022.02.27