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

카테고리

분류 전체보기 (2737)
Unity3D (817)
Script (91)
Extensions (14)
Effect (3)
NGUI (77)
UGUI (8)
Physics (2)
Shader (36)
Math (1)
Design Pattern (2)
Xml (1)
Tips (200)
Link (22)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (70)
Trouble Shooting (68)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (8)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (11)
Ad (14)
Photon (2)
IAP (1)
Google (8)
Android (45)
iOS (41)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-24 00:01

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
, |

[링크] https://github.com/agens-no/iMessageStickerUnity

 

GitHub - agens-no/iMessageStickerUnity: An iMessage Sticker plugin for Unity3d that adds a Sticker extension target to an xCode

An iMessage Sticker plugin for Unity3d that adds a Sticker extension target to an xCode project created by Unity3d - GitHub - agens-no/iMessageStickerUnity: An iMessage Sticker plugin for Unity3d t...

github.com

 

 

반응형
Posted by blueasa
, |



반응형
Posted by blueasa
, |

[링크] https://wergia.tistory.com/353

 

[Unity] 유니티 공식 지원 오브젝트 풀링

개발단에 가입하여 베르의 게임 개발 유튜브를 후원해주세요! 베르의 게임 개발 유튜브 안녕하세요! 여러분들과 함께 게임 개발을 공부하는 베르입니다! 게임 개발에 도움이 되는 강좌들을 올

wergia.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://blog.naver.com/canny708/221557851696

 

버스트 컴파일러 (Burst Compiler)

ECS는 메모리 설계를 최적화하기 위한 기능이고, C# Job System은 멀티 스레딩을 더욱 극한으로 사용...

blog.naver.com

 

반응형
Posted by blueasa
, |

Ever stuck on how to render a video on a TV screen in a game? Lets us learn the concept of playing a video in Unity.

You can import many different formats of video file into Unity. Unity stores such imported video files as VideoClip assets. A Video Clip is an imported video file, which the Video Player component uses to play video content. The playing video also accompanies audio content, if it has any. Typical file extensions for video files include .mp4, .mov, .webm, and .wmv.

To check the video file compatibility in unity, click here.

The Video Player component

Video Player component is used to attach video files to GameObjects, and play them on the GameObject’s Texture at run time.

By default, the Material Property of a Video Player component is set to MainTex, which means that when the Video Player component is attached to a GameObject that has a Renderer, it automatically assigns itself to the Texture on that Renderer (because this is the main Texture for the GameObject).

You can also set the following specific target for the video to play on, using the Render Mode property of Video Player:

  • A Camera plane
  • A Render Texture
  • A Material Texture parameter
  • Any Texture field in a component

Playing a video already in Assets

If you already have a video clip in your asset folder, you can simply set the Source property of Video Player component to Video Clip and drag and drop your video clip in the inspector. Alternatively, you can set the video clip in script using clip property.

    public VideoPlayer myVideoPlayer;
    public VideoClip myClip;
    myVideoPlayer.clip = myClip;

You can tick the property Play On Awake if you want to play the video the moment the Scene launches. Otherwise you can trigger the video playback with Play() command at another point during run time.

    myVideoPlayer.Play();

Playing Video from url in Unity

You might be having a video on server which you want to load on runtime. Here is how we can do it:

    private IEnumerator playVideoInThisURL(string _url)
    {
        myVideoPlayer.source = UnityEngine.Video.VideoSource.Url;
        myVideoPlayer.url = _url;
        myVideoPlayer.Prepare();

        while (myVideoPlayer.isPrepared == false){
           yield return null; 
        }
        myVideoPlayer.Play();
    }

Here, we have waited till the video player successfully prepared the content to be played.

Note, the url can also contain the path of the file.

Downloading and Saving Video from Url

The above line of code plays the video directly from the url. Alternatively, you can download the video file and then play the video from this path. The line of code below downloads the video clip and saves it at Application.persistentDataPath.

    private IEnumerator loadVideoFromThisURL(string _url)
    {
        UnityWebRequest _videoRequest = UnityWebRequest.Get(_url);
        yield return _videoRequest.SendWebRequest();

        if (_videoRequest.isDone == false || _videoRequest.error != null)
        {
            yield return null;
        }
        else
        {
            Debug.Log("Video Done - " + _videoRequest.isDone);
            byte[] _videoBytes = _videoRequest.downloadHandler.data;
            string _pathToFile = Path.Combine(Application.persistentDataPath, "video.mp4");
            File.WriteAllBytes(_pathToFile, _videoBytes);
            StartCoroutine(this.playVideoInThisURL(_pathToFile));
            yield return null;
        }
    }

Now we have learnt the art of playing video in Unity. Drop in your comments for any queries or feedback.

Happy Coding!

 

[출처] https://codesaying.com/playing-video-in-unity/

 

Playing Video in Unity - Code Saying

Ever stuck on how to render a video on a TV screen in a game? Or a full screen video? Lets us learn the art playing a video in Unity.

codesaying.com

 

반응형
Posted by blueasa
, |