블로그 이미지
Every unexpected event is a path to learning for you. blueasa

카테고리

분류 전체보기 (2834)
Unity3D (883)
Script (93)
Extensions (16)
Effect (3)
NGUI (81)
UGUI (9)
Physics (2)
Shader (39)
Math (1)
Design Pattern (2)
Xml (1)
Tips (203)
Link (26)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (85)
Trouble Shooting (71)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (12)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (18)
Ad (14)
Photon (2)
IAP (1)
Google (11)
URP (4)
Android (51)
iOS (46)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (187)
협업 (64)
3DS Max (3)
Game (12)
Utility (140)
Etc (99)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (52)
Android (16)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (19)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

 

[추가] AppName / iOS Privacy 관련 Description 로컬라이징 할 때 사용

 

 

[링크] https://geojun.tistory.com/77

 

유니티 (Unity) - 게임에 다중 언어 (Localization) 적용하기

유니티에서 제공해 주는 다중언어 시스템을 이용한 게임 적용 방법을 알아보겠습니다. "사용된 유니티 버전은 2021.3 입니다. 버전에 따라 조금씩 차이가 있을 수 있습니다." 우선 Package Manager에서

geojun.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://toconakis.tech/ios-sign-in-with-apple/

 

【Unity】iOSでSign in with Appleの実装を解説|toconakis.tech

UnityでiOS向けのSing in with Appleを実装し、FirebaseAuthと連携していく方法を解説し

toconakis.tech

 

반응형
Posted by blueasa
, |

[링크] https://toconakis.tech/unity-ios-google-sign-in/

 

【Unity】iOSネイティブ連携でGoogle Sign Inを実装する方法|toconakis.tech

UnityでGoogle Sign Inを実装する場合、Google公式のライブラリを利用するのが一般的です。 [blo

toconakis.tech

 

반응형
Posted by blueasa
, |

 

[링크] https://github.com/danielshervheim/unity-stylized-water

 

GitHub - danielshervheim/unity-stylized-water: A stylized water shader (and material presets) for Unity.

A stylized water shader (and material presets) for Unity. - GitHub - danielshervheim/unity-stylized-water: A stylized water shader (and material presets) for Unity.

github.com

 

반응형
Posted by blueasa
, |

[Github] https://github.com/Unity-Technologies/com.unity.editoriterationprofiler

 

GitHub - Unity-Technologies/com.unity.editoriterationprofiler: Assists in capturing frames from the Profiler of Domain Reloads i

Assists in capturing frames from the Profiler of Domain Reloads in the Unity Editor. Compatible with Unity 2019.3+. - Unity-Technologies/com.unity.editoriterationprofiler

github.com

--------------------------------------------------------------

 

Editor Iteration Profiler (EIP)
Before diving into the details, I will start by defining what an iteration is. An iteration is a process that contains instructions that are repeated until a condition is met. Unity relies on different types of iterations.

The Editor Iteration Profiler monitors iterations that are related to the scripting side of Unity, specifically entering and exiting playmode, assembly compilation, and assembly reload.

The tool is an attempt to empower you, our users, to understand and help you solve the common question “Why does it take so long to compile my scripts/enter playmode?”. EIP accomplishes this by monitoring profiler frames and saving them in a window where you can more easily navigate through the data the profiler produces. Additionally, the data persists for the whole lifetime of the Editor (or until it’s cleared), as opposed to the Profiler, which has a limit to the number of previously stored frames.

Disclaimer: This tool is still under development and anything could change on the API side.

High-level features summary

  • Monitor and capture profiling data from assembly reload, assembly compilation, and enter playmode.

  • Export captured data or Profiler data to a number of formats such as HTML, JSON (for chrome://tracing, which is a fast flame-graph style data visualizer), CSV, and Plaintext.

  • Export to a special type of HTML (HTML Performance Report), which attempts to minimize the number of clicks needed to get to the important areas of the profiled data, as well as aggregate possible areas of interest which could be optimized (e.g. OnEnable calls)

How to use
Compatible with 2019.3 and later. It might work with earlier versions, but it is not tested.

  1. Download the repository from GitHub - https://github.com/Unity-Technologies/com.unity.editoriterationprofiler. Alternatively, you can get it through OpenUPM: https://openupm.com/packages/com.unity.editoriterationprofiler/

  2. Place the contents in a folder in your Project’s Packages folder

  3. Open up the project and open the window from Windows → Analysis → Editor Iteration Profiler → Show Window

  4. You should see a window very similar to this


The basics
To enable the tool, you just need to click the Enable button in the window. The window doesn’t need to be open afterward: it will run in the background.


After an iteration happens, it will show up in the window as follows:





UI
Please note that the UI might change/have changed slightly, however, the functionality should be the same.



  • Enable - enables the Profiler and sets it to run in Editor mode.

  • Deep Profile - useful to get all information about managed calls. (https://docs.unity3d.com/Manual/ProfilerWindow.html#deep-profiling)

  • Flattening - attempts to reduce the number of clicks needed to get to the place that is of interest. Works by ‘collapsing’ levels which contain multiple parented items with 1 child. Useful for GUI code and Deep Profiling.

  • User Code - is an attempt to filter out engine code and only show code the User might be interested in.

  • Clear - removes recorded events and events which the EIP is looking for.

  • Collapse All - recursively collapses every item.

  • Print to Console - logs the captured data into plaintext into the console/log file.

  • Export… - dropdown to export captured data in various formats.

  • Export Profiler Data… - dropdown to choose between exporting the selected frame in the Profiler Window or exporting multiple frames, frame by frame, between 2 ranges. It will automatically export the data to a selected folder.



  • Search Bar - works as you would expect. Selecting an item and either pressing the F key or clearing the search will automatically expand the tree view to that item.

Exporters

After you have captured some data, you might want to export it. You can do this by clicking the Export… dropdown and choosing a format.





Here you can get the samples exported above for you to test out.

The Formats

Opening the HTML, you will see something similar to this:



It mostly contains the same data as the EIP Window, with the addition of the percentages. Items in square brackets “[ ]” are leaf items without any children.


The JSON format is meant to be used within Google Chrome's chrome://tracing, which works on chromium-based browsers like Google Chrome, Microsoft Edge Chromium (edge://tracing - chrome://tracing will be replaced by it if typed), Opera, etc.. It is a fast, lightweight and Editor-agnostic way to view the captured data in the flame-graph style. In this gif, we show how to load and use the file into chrome://tracing.


CSV can be used to load the data into other programs, for example. It is pretty difficult for humans to make sense of it. Also, please be aware of the ‘header’ which contains environment information in case you plan to do further processing.


Exporting Plaintext is the same as the one it is printed in the console with the “Print to Console” button. Using this, you have the option to isolate the data and not have other information which is in the Editor.log file.


The HTML Performance Report is based on the same structure as the regular HTML report, however, functionally it is different. The purpose of it is to distill the information into something humans would more easily understand. It basically does this by reducing the number of levels you have to click through to get to the areas of interest, where code diverges more.




The items in curly brackets “{ }” represent items that have more children, which were hidden due to the parents being under the minimum set threshold (currently a hard-coded value of 1%).

The colored items represent ‘buckets’ of similar data, which is grouped in one place for convenience. The total time of these items is not added to the original time, it’s only there to give an estimate for that iteration.


Known Bugs/Limitations (must read this before using it)

  • Data might overlap on chrome://tracing because timestamp mismatches between the EIP's timestamp and the Profiler timestamp (to be fixed in the future)

  • Sorting data doesn't work in-window

  • In order to get the most accurate data (especially with DeepProfile enabled), close as many Editor Windows as possible, including the EIP Window itself (it will keep working even when closed if it's Enabled). The reason is that rebuilding the Tree Hierarchy view and repainting the GUI takes time, and it will "pollute" the data you might be looking for. The more data, the more it will be polluted (Deep Profile will naturally lead to this faster). This has been mostly mitigated in 0.1.2-preview (cost is still there, just delayed so it doesn't pollute the data).

  • When clicking the Profiler Window after clicking Enable in the EIP Window, the EIP's state will be overridden to whatever the original setting in the Profiler was

  • May cause unity to crash when closing it while the EIP is Enabled

Feedback
In terms of feedback, we're especially looking for:

  • Are there any useful use-cases not covered?

  • Are there any workflows that are unclear or missing?

  • Is there anything that is unclear or that you don’t understand?

  • Are there any issues or unclear parts in the documentation or this post?


Please feel free to post any feedback in this sub-forum.

How to report bugs
Please open bugs/suggestions at https://github.com/Unity-Technologies/com.unity.editoriterationprofiler/issues.
Please describe the steps as well as include any relevant files necessary for reproduction.

Troubleshooting
If you encounter any problems, the simplest fix is usually to use the Clear button for the window. Another option you can try is through Window → Analysis → Editor Iteration Profiler → Purge Caches.

 

 

[출처] https://forum.unity.com/threads/introducing-the-editor-iteration-profiler.908390/

 

Official - Introducing the Editor Iteration Profiler

Editor Iteration Profiler (EIP) Before diving into the details, I will start by defining what an iteration is. An iteration is a process that contains...

forum.unity.com

 

반응형
Posted by blueasa
, |

Unity 2021.3.37f1

----

 

기존에 Custom Debug.cs를 만들어서 Plugins 폴더에 넣고 Debug.Log 사용 유무를 제어했었는데,

스토어 둘러보다보니 Disable Logs Easy라는게 보여서 살펴보니 좋아보인다.

게다가 Free..

기존의 Debug.cs를 제거하고 이걸로 교체 함.

 

 

[링크] https://assetstore.unity.com/packages/tools/utilities/disable-logs-easy-206473

 

Disable Logs Easy | 유틸리티 도구 | Unity Asset Store

Use the Disable Logs Easy from Dev Dunk Studio on your next project. Find this utility tool & more on the Unity Asset Store.

assetstore.unity.com

 

[참조] https://blueasa.tistory.com/1024

 

디바이스에서 Debug.Log 메시지 출력하지 않도록 하기

[추가] 2024-04-17 #define으로 Editor, Device등 원하는 곳에 띄울 수 있게 약간 변형함 #if UNITY_EDITOR #define MY_DEBUG #endif using UnityEngine; using System.Collections; using System; using UnityEngine.Internal; /// /// It overrides Uni

blueasa.tistory.com

 

반응형
Posted by blueasa
, |

Unity 2021.3.37f1

Lunar Mobile Console - Pro v1.8.5

----

Lunar Mobile Console - Pro에서 Actions and Variables를 사용할 수 있는데,

이번에 enum 넣으면서 참조 링크를 다시 봤는데 enum 관련 작성을 제대로 안해놔서 좀 헤메서..

변수 타입별 사용방법 정리 겸 샘플 작성해서 올려 둠.

 

 

using UnityEngine;
using System.Collections;
using LunarConsolePlugin;

public class AnLunarConsole_Actions_Variables_Manager : MonoBehaviour
{
    public enum eVariablesType
    {
        One,
        Two,
        Three
    }

    [CVarContainer]
    public static class Variables
    {
        public static readonly CVar myBool = new CVar("My boolean value", true);
        public static CVarChangedDelegate CVarChangedDelegate_myBool = null;
        public static readonly CVar myFloat = new CVar("My float value", 3.14f);
        public static CVarChangedDelegate CVarChangedDelegate_myFloat = null;
        public static readonly CVar myInt = new CVar("My integer value", 10);
        public static CVarChangedDelegate CVarChangedDelegate_myInt = null;
        public static readonly CVar myString = new CVar("My string value", "Test");
        public static CVarChangedDelegate CVarChangedDelegate_myString = null;
        public static readonly CEnumVar<eVariablesType> myEnum = new CEnumVar<eVariablesType>("My enum value", eVariablesType.Two);
        public static CVarChangedDelegate CVarChangedDelegate_myEnum = null;
    }

    IEnumerator Start()
    {
        yield return null;

        InitActions();
        InitVariables();

        AddAction();
        AddDelegate();
    }

    void OnDestroy()
    {
        RemoveAction();
        RemoveDelegate();
    }

    #region Actions
    void InitActions()
    {

    }

    void AddAction()
    {
        LunarConsole.RegisterAction("[Common] Action Common 1", Action_Common_1);
        LunarConsole.RegisterAction("[Common] Action Common 2_1", () => Action_Common_2(1));
        LunarConsole.RegisterAction("[Common] Action Common 2_2", () => Action_Common_2(2));
        LunarConsole.RegisterAction("[InGame] Action InGame", Action_InGame);
        LunarConsole.RegisterAction("[OutGame] Action OutGame", Action_OutGame);
    }

    void RemoveAction()
    {
        LunarConsole.UnregisterAllActions(this); // don't forget to unregister!
    }

    void Action_Common_1()
    {
        // do something..
    }

    void Action_Common_2(int _iValue)
    {
        // do something..
    }

    void Action_InGame()
    {
        // do something..
    }

    void Action_OutGame()
    {
        // do something..
    }
    #endregion

    #region Variables
    void InitVariables()
    {
        Variables.myBool.BoolValue = true;
        Variables.myFloat.FloatValue = 3.14f;
        Variables.myInt.IntValue = 10;
        Variables.myString.Value = "Test";
        //Variables.myEnum.EnumValue = eVariablesType.Two;  // Can't
    }

    void AddDelegate()
    {
        // myBool
        Variables.CVarChangedDelegate_myBool = (value) =>
        {
            UnityEngine.Debug.Log("[myBool is] " + value);
            OnCVarChangedDelegate_myBool(value);
        };
        Variables.myBool.AddDelegate(Variables.CVarChangedDelegate_myBool);

        // myFloat
        Variables.CVarChangedDelegate_myFloat = (value) =>
        {
            UnityEngine.Debug.Log("[myFloat is] " + value);
            OnCVarChangedDelegate_myFloat(value);
        };
        Variables.myFloat.AddDelegate(Variables.CVarChangedDelegate_myFloat);

        // myInt
        Variables.CVarChangedDelegate_myInt = (value) =>
        {
            UnityEngine.Debug.Log("[myInt is] " + value);
            OnCVarChangedDelegate_myInt(value);
        };
        Variables.myInt.AddDelegate(Variables.CVarChangedDelegate_myInt);

        // myString
        Variables.CVarChangedDelegate_myString = (value) =>
        {
            UnityEngine.Debug.Log("[myString is] " + value);
            OnCVarChangedDelegate_myString(value);
        };
        Variables.myString.AddDelegate(Variables.CVarChangedDelegate_myBool);

        // myEnum
        Variables.CVarChangedDelegate_myEnum = (value) =>
        {
            UnityEngine.Debug.Log("[myEnum is] " + value);
            CEnumVar<eVariablesType> cEnumVar = (CEnumVar<eVariablesType>)value;
            eVariablesType eEnumValue = cEnumVar.EnumValue;
            OnCVarChangedDelegate_myEnum(eEnumValue);
        };
        Variables.myEnum.AddDelegate(Variables.CVarChangedDelegate_myEnum);
    }

    void RemoveDelegate()
    {
        Variables.myBool.RemoveDelegate(Variables.CVarChangedDelegate_myBool);
        Variables.myFloat.RemoveDelegate(Variables.CVarChangedDelegate_myFloat);
        Variables.myInt.RemoveDelegate(Variables.CVarChangedDelegate_myInt);
        Variables.myString.RemoveDelegate(Variables.CVarChangedDelegate_myString);
        Variables.myEnum.RemoveDelegate(Variables.CVarChangedDelegate_myEnum);
    }

    void OnCVarChangedDelegate_myBool(bool _bValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myFloat(float _fValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myInt(int _iValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myString(string _strValue)
    {
        // do something..
    }

    void OnCVarChangedDelegate_myEnum(eVariablesType _eVariablesType)
    {
        // do something..
    }
    #endregion
}

 

 

[참조] https://github.com/SpaceMadness/lunar-unity-console/wiki/Actions-and-Variables#listening-for-variable-changes

 

Actions and Variables

High-performance Unity iOS/Android logger built with native platform UI - SpaceMadness/lunar-unity-console

github.com

 

반응형
Posted by blueasa
, |

AppIconChangerUnity
https://github.com/kyubuns/AppIconChangerUnity

Change the app icon dynamically in Unity
Support for new icon formats in Xcode13
-> This means that A/B Test on AppStore is also supported.


- iOS only, require iOS 10.3 or later



## Instructions
- Import by PackageManager `https://github.com/kyubuns/AppIconChangerUnity.git?path=Assets/AppIconChanger`
- (Optional) You can import a demo scene on PackageManager.




## Quickstart

- Create `AppIconChanger > AlternateIcon` from the context menu




- Set the name and icon





- The following methods are available




## Tips


### What is the best size for the app icon?

When the Type of `AlternateIcon` is set to Auto Generate, the icon will be automatically resized at build time, so there is nothing to worry about. (The maximum size is 1024px.)
If you want to control it in detail, you can change the Type to Manual.





## Requirements
- Unity 2020.3 or higher.
- Xcode 13 or higher.



## License
MIT License (see LICENSE)

 

 

[출처] https://forum.unity.com/threads/appiconchangerunity-change-the-app-icon-dynamically-in-unity-ios-only.1245787/

 

AppIconChangerUnity - Change the app icon dynamically in Unity (iOS only)

AppIconChangerUnity https://github.com/kyubuns/AppIconChangerUnity Change the app icon dynamically in Unity Support for new icon formats in Xcode13 ->...

forum.unity.com

 

반응형
Posted by blueasa
, |

Unity 2021.3.37f1

Obfuscator 3.12.0

----

 

[추가] 2024-04-15

Android - Google Play Asset Delivery로 Build 시,

nameTranslation.txt 파일을 상대경로(파일명만)로 지정했을 때 제대로 생성하지 못하는 문제가 있어서 우회하도록 수정함.

BuildReport에서 주는 빌드파일 경로를 쓰지 않고, string.Format(@"{0}/..", Application.dataPath) 로 프로젝트 패스를 쓰도록 변경함.

해당 방식을 쓰기위해 Android 일 때만, Obfuscator의 OptionsManager.cs의 LoadAssetAtPath 함수를 아래와 같이 일부 수정했다.

using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace Beebyte.Obfuscator
{
    public class OptionsManager
    {
        ....
       
        private static Options LoadAssetAtPath(string path)
        {
            // [Android] nameTranslationFile Path 변경
            if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
            {
                // Custom
                Options o = AssetDatabase.LoadAssetAtPath<Options>(path);
                if (o == null)
                {
                    return null;
                }

                // 옵션값 덮어쓰지 않도록 Clone해서 사용.
                var clone_o = Object.Instantiate(o);

                /// 현재 프로젝트 절대 경로(Application.dataPath/../)로 수정 반환
                // 파일명(Default:nameTranslation.txt)만 추출해서 저장
                string strnameTranslation = System.IO.Path.GetFileName(clone_o.nameTranslationFile);
                // 현재 프로젝트 Path 적용. 절대경로값 지정
                clone_o.nameTranslationFile = string.Format(@"{0}/../{1}", Application.dataPath, strnameTranslation);
                return clone_o;
            }
            // [iOS] 기존 방식
            else
            {
                // Original
                return AssetDatabase.LoadAssetAtPath<Options>(path);
            }
        }
        
        ....
    }
}

 

 

----

Obfuscator에 난독화 기능을 쓸 때,

난독화 전/후 Naming 매칭 리스트를 뽑아주는 옵션이 있다.(아래 스샷 참조)

ObfuscatorOptions.asset

 

 

체크하면 기본 파일명이 nameTranslation.txt인데 빌드 할 때마다 덮어버리니 관리가 안돼서 빌드마다 별도로 만들어질 수 있도록 PostProcess로 파일명을 Rename 하도록 처리했다.

 

아래 소스를 프로젝트에 추가하면,

[Android] namteTranslation.txt 파일을 빌드 파일명에 매칭해서 자동으로 변경해준다.

ex) 빌드 파일명 : abc_v1.0.0.apk

      변경되는 파일명 : abc_v1.0.0.apk_ namteTranslation.txt

 

[iOS] iOS는 빌드 시점에 파일명이 지정되는게 아니라서 별도의 조합으로 진행되도록 했다.

          ex) abc_live_1.0.0(100)_20231206_183400_iOS_nameTranslation.txt

 

 

using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.Callbacks;
using System;

/// <summary>
/// [PostProcess] Obfuscator : Rename nameTranslation.txt -> {BuildFileName.ext}_nameTranslation.txt
/// </summary>
public sealed class PostProcessBuild_Obfuscator_NameTransition_Renamer : IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
    public int callbackOrder => 0;

    private static readonly string m_strNameTranslation_Src = "nameTranslation";    // Obfuscator 기본값
    private static readonly string m_strExt_txt = "txt";


    public void OnPreprocessBuild(BuildReport report)
    {
        // 1. ./BUILD_PATH/nameTranslation.txt 파일 유무 체크
        // 2. 있으면 - Delete(Clear)

        string strBuildPath = string.Empty;
        string strNameTranslation_txt_Src = string.Empty;

        switch (report.summary.platform)
        {
            case BuildTarget.Android:
                {
                    // 현재 프로젝트 Path 적용(절대경로 지정)
                    // [Obfuscator-OptionsManager.cs:line 140] 연관됨
                    strBuildPath = string.Format(@"{0}/..", Application.dataPath);
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);
                }
                break;

            case BuildTarget.iOS:
                {
                    strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);
                }
                break;
        }

        if (true == File.Exists(strNameTranslation_txt_Src))
        {
            File.Delete(strNameTranslation_txt_Src);
            Debug.LogWarningFormat("[Delete] {0}", strNameTranslation_txt_Src);
        }
    }

    public void OnPostprocessBuild(BuildReport report)
    {
        Debug.LogWarningFormat("[OnPostprocessBuild][platform] {0} [pathToBuildProject] {1}", report.summary.platform, report.summary.outputPath);

        string strBuildPath = string.Empty;                 // 빌드 패스
        string strBuildFileName_with_Ext = string.Empty;    // 파일네임.확장자
        string strExt = string.Empty;                       // 확장자(.apk/.aab/.ipa)
        string strNameTranslation_txt_Src = string.Empty;   // [Src] nameTranslation.txt
        string strNameTranslation_txt_Dest = string.Empty;  // [Dest] nameTranslation.txt

        string strLunarConsole = "";
        if (true == LunarConsolePluginInternal.LunarConsoleConfig.consoleEnabled)
        {
            strLunarConsole = string.Format("_LunarConsole");
        }

        switch (report.summary.platform)
        {
            case BuildTarget.Android:
                {
                    // 현재 프로젝트 Path 적용(절대경로 지정)
                    // [Obfuscator-OptionsManager.cs:line 140] 연관됨
                    strBuildPath = string.Format(@"{0}/..", Application.dataPath);
                    //strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    strBuildFileName_with_Ext = Path.GetFileName(report.summary.outputPath);
                    strExt = Path.GetExtension(report.summary.outputPath);  // .apk / .aab
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);

                    string strProductName = string.Format("{0}", Application.productName);
                    string strServer = string.Format("{0}", ClientSettings.ServerType.ToString());
                    string strVersion = string.Format("{0}", Application.version);
                    string strBundleVersionCode = string.Format("{0}", PlayerSettings.Android.bundleVersionCode);
                    string strDateTime = string.Format("{0}", DateTime.Now.ToString("yyyyMMdd_HHmmss", System.Globalization.CultureInfo.InvariantCulture));
                    string strPlatform = string.Format("{0}", report.summary.platform);

                    strNameTranslation_txt_Dest = string.Format(@"{0}/{1}_{2}_{3}({4})_{5}{6}_{7}{8}_{9}.{10}",
                                                                    strBuildPath,               // {0}
                                                                    strProductName,             // {1}
                                                                    strServer,                  // {2}
                                                                    strVersion,                 // {3}
                                                                    strBundleVersionCode,       // {4}
                                                                    strDateTime,                // {5}
                                                                    strExt,                     // {6}
                                                                    strPlatform,                // {7}
                                                                    strLunarConsole,            // {8}
                                                                    m_strNameTranslation_Src,   // {9}
                                                                    m_strExt_txt                // {10}
                                                                    );

                    #region OutputPath 기준 방식(Google Asset Delivery 대응 안됨)
                    //strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    //strBuildFileName_with_Ext = Path.GetFileName(report.summary.outputPath);
                    //strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);
                    //// Build File과 매칭하기 쉽도록
                    //// BuildFileName.ext_nameTranslation.txt 형태로 Dest 생성
                    //strNameTranslation_txt_Dest = string.Format("{0}/{1}_{2}.{3}", strBuildPath, strBuildFileName_with_Ext, m_strNameTranslation_Src, m_strExt_txt);
                    #endregion
                }
                break;

            case BuildTarget.iOS:
                {
                    /// iOS outputPath는 폴더만 있음(파일명.확장자는 없음.)
                    /// ex) [report.summary.outputPath] /User/{Users}/project_folder/build_folder

                    // ex) [Path.GetDirectoryName] /User/{Users}/project_folder
                    strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    // ex) [Path.GetFileName] build_folder
                    strBuildFileName_with_Ext = Path.GetFileName(report.summary.outputPath);
                    //strExt = Path.GetExtension(report.summary.outputPath);  // .ipa   // empty
                    strExt = string.Format(".ipa"); // 직접 추가
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);

                    string strProductName = string.Format("{0}", Application.productName);
                    string strServer = string.Format("{0}", Anne.ClientSettings.ServerType.ToString());
                    string strVersion = string.Format("{0}", Application.version);
                    string strBuildNumber = string.Format("{0}", PlayerSettings.iOS.buildNumber);
                    string strDateTime = string.Format("{0}", DateTime.Now.ToString("yyyyMMdd_HHmmss", System.Globalization.CultureInfo.InvariantCulture));
                    string strPlatform = string.Format("{0}", report.summary.platform);

                    strNameTranslation_txt_Dest = string.Format(@"{0}/{1}_{2}_{3}({4})_{5}{6}_{7}{8}_{9}.{10}",
                                                                    strBuildPath,               // {0}
                                                                    strProductName,             // {1}
                                                                    strServer,                  // {2}
                                                                    strVersion,                 // {3}
                                                                    strBuildNumber,             // {4}
                                                                    strDateTime,                // {5}
                                                                    strExt,                     // {6}
                                                                    strPlatform,                // {7}
                                                                    strLunarConsole,            // {8}
                                                                    m_strNameTranslation_Src,   // {9}
                                                                    m_strExt_txt                // {10}
                                                                    );
                }
                break;
        }

        Debug.LogWarningFormat("[strNameTranslation_txt_Src] {0} [strNameTranslation_txt_Dest] {1}", strNameTranslation_txt_Src, strNameTranslation_txt_Dest);
        
        // 1. ./PROJECT_PATH/nameTranslation.txt 파일 유무 체크
        // 2. 있으면 - Rename : 해당 버전명 날짜/시간 파일명에 포함
        if (true == File.Exists(strNameTranslation_txt_Src))
        {
            File.Move(strNameTranslation_txt_Src, strNameTranslation_txt_Dest);
            Debug.LogWarningFormat("[Rename] {0} -> {1}", strNameTranslation_txt_Src, strNameTranslation_txt_Dest);
        }
        else
        {
            Debug.LogWarningFormat("[File Not Exists] {0}", strNameTranslation_txt_Src);
        }
    }
}
반응형
Posted by blueasa
, |

[추가2] 2024-04-08

Unity 2021.3.37f1

GoogleMobileAds 8.6.0

Firebase SDK 11.8.0

----

Unity 2021.3.37f1에서 기본 Gradle 버전이 Gradle 4.2.2로 버전업 되면서 별도로 Gradle 4.2.0을 다운받고 설정할 필요가 없어졌다.

그리고, Gradle 4.2.0에서 체크해야됐던 GoogleMobileAdsSettings 옵션을 더이상 체크 안해도 되게 됐다.

정리하자.

 

----

Unity 2021.3.32f1

GoogleMobileAds 8.6.0

Firebase SDK 11.6.0

----

 

[추가]

gradle을 Unity 2021 기본인 gradle plugin 4.0.1에서 gradle plugin 4.2.0으로 변경하고 나서

Unity Editor에서는 빌드가 잘되는데 이상하게 jenkins Android 에서만 빌드가 실패해서 삽질하면서 알아보니

jenkins를 Mac에 셋팅해뒀는데 gradle cache 폴더가 뭔가 꼬인 것 같다.

아래와 같은 Warning Log가 엄청나게 뜬다.

 

[Warning Log]

WARNING:/Users/{UserAccount}/.gradle/caches/transforms-2/files-2.1/ea30c3c071cd48c926311878c13eb08b/jetified-unity-classes.jar: D8: Expected stack map table for method with non-linear control flow.

 

그래서 아래 위치의 gradle cache 하위 있는 것들을 모두 삭제하고 새로 빌드를 실행해서 잘 돌아가는 것을 확인했다.

 

[Mac gradle cache 위치] /Users/{UserAccount}/.gradle/caches/

 

----

 

이번에 메모리 누수 이슈로 Unity 메이저 버전을 2022 -> 2021로 내렸는데,

GoogleMobileAds가 업데이트 돼서 기존 사용하던 8.4.1 -> 8.6.0으로 올리면서 Unity 버전관련해서 체크해야 될 사항들 간단히 정리해 둠.

 

일단 Unity 2022.3 이상은 상관 없었는데 2021.3으로 내려오면서 gradle 버전이 낮아지면서 처리할 문제가 생겼다.

아래 2가지 이슈를 수정하고 빌드 하자.

 

1) Unity 2021.3.32f1이 기본이 com.android.tools.build:gradle:4.0.1로 돼 있는데,

    GoogleMobileAds 8.6.0이 com.android.tools.build:gradle:4.2.0을 요구하고 있다.

    아래 링크의 내용을 참조해서 Base Gradle Templete에서 gradle plugin을 4.2.0으로 수정하고, gradle 6.7.1을 설치 및 연동하자.

 

   [설명 링크] https://developers.google.com/admob/unity/gradle?hl=ko#unity-integrated-builds

 

Android용 Gradle 업그레이드  |  Unity  |  Google for Developers

이 페이지는 Cloud Translation API를 통해 번역되었습니다. Switch to English Android용 Gradle 업그레이드 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. The Google Mobile Ad

developers.google.com

 

['gradle 6.7.1 bin' Download Link] https://gradle.org/next-steps/?version=6.7.1&format=bin

 

Gradle | Thank you for downloading Gradle!

Next steps after downloading Gradle

gradle.org

 

2) 그리고, GoogleMobileAds 셋팅 파일에 Unity 2022.1 이하 프로젝트 관련 옵션이 2개 추가 되어 있는데,

     Unity 2021.3을 쓰고 있어서 둘 다 체크해야 된다.

    아래 내용과 링크를 참조하자.

GoogleMobileAds 8.6.0 Settings

 

[참조 링크] https://github.com/googleads/googleads-mobile-unity/issues/2930

 

play-services-ads:22.4.0 issue · Issue #2930 · googleads/googleads-mobile-unity

[REQUIRED] Step 1: Describe your environment Unity version: 2021.3.30f1 Google Mobile Ads Unity plugin version: 8.5.2 Platform: Android - Unity Editor Mediation ad networks used, and their versions...

github.com

 

[잡담]

Google도 이제 대충 하는건지..

이번에 새로 추가된 class 중에 Utils가 있는데 다른데서도 많이 쓰는 이름인데 namespace를 지정 안해놔서 클래스 명 충돌이 나서 namespace GoogleMobileAds로 처리 했다.

 

 

----

[참고]

Firebase도 당장은 아니지만(현재 Firebase SDK 11.6.0 기준 Firebase Android BoM 32.3.1) 추후 버전에서 곧 Android Gradle Plugin 버전을 4.2.0으로 강제하게 될 것 같다.

Firebase Android BoM Release Notes

[링크] https://firebase.google.com/support/release-notes/android

 

Firebase Android SDK Release Notes

 

firebase.google.com

반응형
Posted by blueasa
, |