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

카테고리

분류 전체보기 (2769)
Unity3D (838)
Programming (475)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (229)
협업 (10)
3DS Max (3)
Game (12)
Utility (69)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (52)
Android (15)
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

[링크] https://drehzr.tistory.com/2194

 

Unity) Search Extension (검색 기능 확장하기)

Search Extension (검색 기능 확장하기)   프로젝트의 리소스의 종속성도 꽤나 잘 검색이 되는것으로 판단 된다.좀더 참고해서 작업할수 있지 않을까 고민하다가 간략하게 사용해보고 후기에 대

drehzr.tistory.com

 

반응형
Posted by blueasa
, |

[링크]

https://wlsdn629.tistory.com/entry/%EC%9C%A0%EB%8B%88%ED%8B%B0-%EA%B2%8C%EC%9E%84-%ED%99%94%EB%A9%B4-%EB%85%B9%ED%99%94%EC%98%81%EC%83%81%EC%B4%AC%EC%98%81%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95

 

유니티 게임 화면 녹화(영상촬영)하는 방법

Recorder 임포트하기 Package Manager를 열어 Recorder를 찾아준 후 Install를 눌러 설치해줍니다. 설치가 끝나면 상단 [Window] - [General] 탭으로 들어가보면 Recorder가 생긴 것을 확인할 수 있습니다. 촬영하기

wlsdn629.tistory.com

 

반응형
Posted by blueasa
, |

Unity 2021.3.40f1

I2 Localization v2.8.22 f4

----

I2 Localization의 AppName 로컬라이징을 사용하고 있는데,

PostProcessBuild_iOS.cs를 약간 개조(추가)해서 iOS Privacy도 로컬라이징 하도록 추가함.

(현재는 ATT 관련 Description인 NSUserTrackingUsageDescription Privacy를 추가함)

 

아래 소스를 I2 Localization 하위에 있는 PostProcessBuild_iOS.cs가 있는 폴더에 넣거나,

원하는 곳 Editor 폴더 아래에 넣으면 된다.

 

난 에셋 삭제 시 함께 사라지는 걸 방지하기 위해 아래 위치에 추가해 뒀다.

[소스 위치] ../Assets/I2_Extentions/Localization/Scripts/Editor/PostProcessBuild_iOS_Privacy.cs

 

#if UNITY_IOS || UNITY_IPHONE
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS_I2Loc.Xcode;
using System.IO;
using UnityEditor;
using UnityEngine;
using System.Linq;


namespace I2.Loc
{
    public class PostProcessBuild_IOS_Privacy
    {
        // PostProcessBuild_IOS(10000) 다음에 실행 되도록 10001로 지정함.
        [PostProcessBuild(10001)]
        public static void ChangeXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)
        {
            if (buildTarget != BuildTarget.iOS)
                return;

			if (LocalizationManager.Sources.Count <= 0)
				LocalizationManager.UpdateSources();
            var langCodes = LocalizationManager.GetAllLanguagesCode(false).Concat(LocalizationManager.GetAllLanguagesCode(true)).Distinct().ToList();
            if (langCodes.Count <= 0)
				return;
				
            try
            {
			//----[ Export localized languages to the info.plist ]---------

                string plistPath = pathToBuiltProject + "/Info.plist";
                PlistDocument plist = new PlistDocument();
                plist.ReadFromString(File.ReadAllText(plistPath));

				PlistElementDict rootDict = plist.root;

                // Get Language root
                var langArray = rootDict.CreateArray("CFBundleLocalizations");

                // Set the Language Codes
                foreach (var code in langCodes)
                {
                    if (code == null || code.Length < 2)
                        continue;
                    langArray.AddString(code);
                }

				rootDict.SetString("CFBundleDevelopmentRegion", langCodes[0]);

                // Write to file
                File.WriteAllText(plistPath, plist.WriteToString());

			//--[ Localize Privacy ]----------

				string LocalizationRoot = pathToBuiltProject + "/I2Localization";
				if (!Directory.Exists(LocalizationRoot))
					Directory.CreateDirectory(LocalizationRoot);
				
				var project = new PBXProject();
				string projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
				//if (!projPath.EndsWith("xcodeproj"))
					//projPath = projPath.Substring(0, projPath.LastIndexOfAny("/\\".ToCharArray()));

				project.ReadFromFile(projPath);
				//var targetName = PBXProject.GetUnityTargetName();
				//string projBuild = project.TargetGuidByName( targetName );

                // 상위(PostProcessBuild_IOS.cs)에서 이미 지우고 생성했기 때문에 주석처리.
				//project.RemoveLocalizationVariantGroup("I2 Localization");
				
                // Set the Language Overrides
				foreach (var code in langCodes)
				{
					if (code == null || code.Length < 2)
						continue;

					var LanguageDirRoot = LocalizationRoot + "/" + code + ".lproj";
					if (!Directory.Exists(LanguageDirRoot))
						Directory.CreateDirectory(LanguageDirRoot);

					var infoPlistPath = LanguageDirRoot + "/InfoPlist.strings";
                    
                    // AppName
                    //var InfoPlist = string.Format("CFBundleDisplayName = \"{0}\";", LocalizationManager.GetAppName(code));
                    //File.WriteAllText(infoPlistPath, InfoPlist);
                    
                    // Privacy - NSUserTrackingUsageDescription
                    // 다른 Privacy 필요하면 아래 추가하면 됨.
                    var InfoPlist = string.Format("\n{0} = \"{1}\";", "NSUserTrackingUsageDescription", Get_NSUserTrackingUsageDescription(code));
                    File.AppendAllText(infoPlistPath, InfoPlist);


                    //var langProjectRoot = "I2Localization/"+code+".lproj";

                    // InfoPlist.strings만 수정할거라 Localizable.strings는 주석처리.
                    //var stringPaths = LanguageDirRoot + "/Localizable.strings";
                    //File.WriteAllText(stringPaths, string.Empty);

                    // AddLocalization은 PostProcessBuild_IOS.cs에서 했기 때문에 주석처리 함.
                    //project.AddLocalization(langProjectRoot + "/Localizable.strings", langProjectRoot + "/Localizable.strings", "I2 Localization");
                    //project.AddLocalization(langProjectRoot + "/InfoPlist.strings", langProjectRoot + "/InfoPlist.strings", "I2 Localization");
                }

                project.WriteToFile(projPath);
				
            }
            catch (System.Exception e)
            { 
				Debug.Log (e);
			}
        }

        /// <summary>
        /// NSUserTrackingUsageDescription(IDFA/ATT)
        /// </summary>
        /// <param name="_code">국가코드</param>
        /// <returns>로컬라이징 된 Description</returns>
		private static string Get_NSUserTrackingUsageDescription(string _code)
		{
			string strDescription = string.Empty;

			switch(_code)
			{
								case "en":
					strDescription = "This identifier will be used to deliver personalized ads to you.";
					break;

                case "ko":
                    strDescription = "이 식별자는 맞춤형 광고를 제공하는 데 사용됩니다.";
                    break;

                case "zh":      // zh도 zh-CN(중국본토)으로 보도록 함
                case "zh-CN":
                    strDescription = "该标识符将用于向您投放个性化广告。";
                    break;

                case "zh-TW":
                    strDescription = "該標識符將用於向您投放個人化廣告。";
                    break;

                case "ja":
                    strDescription = "この識別子は、パーソナライズされた広告を配信するために使用されます。";
                    break;

                case "vi":
                    strDescription = "Mã nhận dạng này sẽ được sử dụng để phân phối quảng cáo được cá nhân hóa cho bạn.";
                    break;

                case "es":
                    strDescription = "Este identificador se utilizará para enviarle anuncios personalizados.";
                    break;

                case "it":
                    strDescription = "Questo identificatore verrà utilizzato per fornirti annunci personalizzati.";
                    break;

                case "id":
                    strDescription = "Pengenal ini akan digunakan untuk menayangkan iklan yang dipersonalisasi kepada Anda.";
                    break;

                case "th":
                    strDescription = "ตัวระบุนี้จะใช้ในการส่งโฆษณาส่วนบุคคลให้กับคุณ";
                    break;

                case "pt":
                    strDescription = "Este identificador será utilizado para lhe entregar anúncios personalizados.";
                    break;

                case "hi":
                    strDescription = "इस पहचानकर्ता का उपयोग आपको वैयक्तिकृत विज्ञापन देने के लिए किया जाएगा.";
                    break;

                default:
                    strDescription = "This identifier will be used to deliver personalized ads to you.";
                    break;
			}

			return strDescription;

        }
    }
}
#endif
반응형
Posted by blueasa
, |

[링크]

https://velog.io/@maratangsoft/Android%EC%99%80-Unity-%EA%B0%84-Gradle-%EB%B2%84%EC%A0%84-%EA%B4%80%EB%A6%AC

 

Android와 Unity 간 버전 호환성 관리

유니티 에디터로 만든 안드로이드 앱에 안드로이드 라이브러리 통합시

velog.io

 

반응형
Posted by blueasa
, |

[Android] https://docs.unity3d.com/Packages/com.unity.localization@1.2/manual/Android-App-Localization.html

 

Android App Localization | Localization | 1.2.1

Android App Localization App Name The Localization package supports localizing app names with the Android strings.xml file. When you build the Android player, the package applies the Localization values to the Gradle project during the post-build step. The

docs.unity3d.com

 

 

[iOS] https://docs.unity3d.com/Packages/com.unity.localization@1.2/manual/iOS-App-Localization.html

 

iOS App Localization | Localization | 1.2.1

iOS App Localization The Localization package provides support for localizing values within the iOS Info.plist information property list file. When building the iOS player, the Localization values are applied to the project during the post build step. The

docs.unity3d.com

 

반응형
Posted by blueasa
, |

 

[추가] 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/glassmorphism/

 

【Unity】すりガラス風UIの作り方を解説 -グラスモーフィズム-|toconakis.tech

現在開発中の個人開発ゲーム「EUREKA5」で使っている「すりガラス風UI」の作り方を解説します。   EUR

toconakis.tech

 

Shader "glassShader"
{
    Properties
    {
        _MainTex("Texture", 2D) = "white" {}
        _Blur("Blur", Float) = 10
    }
    SubShader
    {

        Tags{ "Queue" = "Transparent" }

        GrabPass
        {   
        }

        Pass
        {
            CGPROGRAM

            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
                fixed4 color : COLOR;
            };

            struct v2f
            {
                float4 grabPos : TEXCOORD0;
                float4 pos : SV_POSITION;
                float4 vertColor : COLOR;
            };

            v2f vert(appdata v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.grabPos = ComputeGrabScreenPos(o.pos);
                o.vertColor = v.color;
                return o;
            }

            sampler2D _GrabTexture;
            fixed4 _GrabTexture_TexelSize;

            float _Blur;

            half4 frag(v2f i) : SV_Target
            {
                float blur = _Blur;
                blur = max(1, blur);

                fixed4 col = (0, 0, 0, 0);
                float weight_total = 0;

                [loop]
                for (float x = -blur; x <= blur; x += 1)
                {
                    float distance_normalized = abs(x / blur);
                    float weight = exp(-0.5 * pow(distance_normalized, 2) * 5.0);
                    weight_total += weight;
                    col += tex2Dproj(_GrabTexture, i.grabPos + float4(x * _GrabTexture_TexelSize.x, 0, 0, 0)) * weight;
                }

                col /= weight_total;
                return col;
            }
            ENDCG
        }
        GrabPass
        {   
        }

        Pass
        {
            CGPROGRAM

            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
                fixed4 color : COLOR;
            };

            struct v2f
            {
                float4 grabPos : TEXCOORD0;
                float4 pos : SV_POSITION;
                float4 vertColor : COLOR;
            };

            v2f vert(appdata v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.grabPos = ComputeGrabScreenPos(o.pos);
                o.vertColor = v.color;
                return o;
            }

            sampler2D _GrabTexture;
            fixed4 _GrabTexture_TexelSize;

            float _Blur;

            half4 frag(v2f i) : SV_Target
            {
                float blur = _Blur;
                blur = max(1, blur);

                fixed4 col = (0, 0, 0, 0);
                float weight_total = 0;

                [loop]
                for (float y = -blur; y <= blur; y += 1)
                {
                    float distance_normalized = abs(y / blur);
                    float weight = exp(-0.5 * pow(distance_normalized, 2) * 5.0);
                    weight_total += weight;
                    col += tex2Dproj(_GrabTexture, i.grabPos + float4(0, y * _GrabTexture_TexelSize.y, 0, 0)) * weight;
                }

                col /= weight_total;
                return col;
            }
            ENDCG
        }

    }
}
반응형
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
, |

[Unity] JDK 11 support

Unity3D/Tips / 2024. 6. 4. 10:50

Unity 2021.3.38f1

Unity 2021.3.40f1

----

 

[추가] 2024-07-11

Unity 2021에서 Android Target API 34 적용(https://blueasa.tistory.com/2838)하고, Firebase 12 이상 버전을 업뎃해서 빌드 테스트 해보니 잘된다.

결국 Android Target API 34에 물린 문제인가 싶다.

 

----

Firebase 12.0.0을 업뎃하려고 보니 Authentication쪽에서 JDK 11을 요구한다.

Unity 2021에서 JDK 11을 사용하려고 별도로 다운받아서 연결해서 빌드해보니, Unity 2021에서는 JDK 1.8만 사용가능하다면서 에러가 뜬다.

 

그래서 찾아보니 JDK 11은 Unity 2022.3 이후 버전부터 지원하는 것 같다.

결국 Firebase 12.0.0(정확히는 Authentication)를 사용하려면. JDK 11을 지원하는 Unity 2022.3 이후 버전으로 올려야 될 것 같다.

 

Unity 2021 버전은 Firebase 11.9.0이 마지막 버전인가.. 싶다.

 

 

[링크] https://forum.unity.com/threads/jdk-11-support.1261301/

 

Question - JDK 11 support

Starting API 31, JDK 11 is a requirement due to addition of new annotations used by some of the dependencies. If I try to target api 31, it fails with...

forum.unity.com

 

[참조]

  • Unity Editor 2022.2 미만 버전은 JDK 8만 지원한다. 해당 버전의 Unity Editor를 쓴다고 해서 Android Studio도 반드시 JDK 8을 써야 하는 건 아니지만, 혹시나 JDK 관련 에러가 다른 방법으로 고쳐지지 않을 경우 스튜디오 버전을 4.1.x로 내리는 것을 시도해보면 좋을 것 같다. 참고 공식문서

[참조링크] https://velog.io/@maratangsoft/Android%EC%99%80-Unity-%EA%B0%84-Gradle-%EB%B2%84%EC%A0%84-%EA%B4%80%EB%A6%AC#unity--jdk

 

Android와 Unity 간 버전 호환성 관리

유니티 에디터로 만든 안드로이드 앱에 안드로이드 라이브러리 통합시

velog.io

 

반응형
Posted by blueasa
, |