728x90

๐ŸŽฎ Unity Study/Unity 59

[Unity][MenuItem hotkey(shortkey)] %(ctrl, cmd), #(shift), &(alt)...

To create a hotkey, use the following special characters: % (ctrl on Windows and Linux, cmd on macOS), ^ (ctrl on Windows, Linux, and macOS), # (shift), & (alt). If no special modifier key combinations are required, the key can be given after an underscore. For example, to create a menu with the hotkey Shift+Alt+G, use "MyMenu/Do Something #&g". To create a menu with hotkey G and no key modifier..

[Unity] Github package npm ๋ฐฐํฌ

*Github Package ? 1. Unity package ๋งŒ๋“ค๊ธฐ package ๋ฅผ github registry ์— publish ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” registry ๋ฅผ ์—ฐ๊ฒฐํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค. package ๋ฅผ registry ์— ์—ฐ๊ฒฐํ•˜๋Š” ๋ฒ•์€ ์—ฌ๋Ÿฌ ๊ฐ€์ง€๊ฐ€ ์žˆ๋‹ค. ๋‚˜๋Š” unity ํ”„๋กœ์ ํŠธ ์ด๋ฏ€๋กœ Unity Package Manager ๋ฅผ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋Š” package.json ํŒŒ์ผ์„ ์ด์šฉํ–ˆ๋‹ค. package.json ํŒŒ์ผ ์•ˆ์— publishConfig ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ package ๋ฅผ registry ๋ฅผ ์—ฐ๊ฒฐํ•˜๋ฉด ๋œ๋‹ค. "publishConfig": { "registry": "https://npm.pkg.github.com" }, [package ๋งŒ๋“ค ๋•Œ ์ฃผ์˜์‚ฌํ•ญ] 1) package ์ด๋ฆ„(name)๊ณผ ๋ฒ”..

Android API version ๋ณ„ SDK ๋ฒ„์ „(feat. Unity ๋ฒ„์ „ ๋ณ„ NDK, JDK Version)

Andorid 13 -> Android API 33 Andoird 12 -> Andorid API 32, 31 Andorid 11 -> Android API 30 https://developer.android.com/studio/releases/platforms?hl=ko SDK ํ”Œ๋žซํผ ์ถœ์‹œ ๋…ธํŠธ | Android ๊ฐœ๋ฐœ์ž | Android Developers SDK Manager์˜ SDK Platforms ํƒญ์—์„œ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋Š” SDK ํŒจํ‚ค์ง€์— ๊ด€ํ•œ ์ถœ์‹œ ์ •๋ณด๋ฅผ ํ™•์ธํ•˜์„ธ์š”. developer.android.com https://docs.unity3d.com/Manual/android-sdksetup.html Unity - Manual: Android environment setup Getting st..

[Unity] Custom Unity Package in Git ๋งน๋“ค๊ธฐ

ํšŒ์‚ฌ์—์„œ ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ์‹œ ํ•„์š”ํ•œ ๊ณตํ†ต๋ชจ๋“ˆ์„ ๊ฐ๊ฐ ๋‹ค์šด๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” Editor ํ™”๋ฉด์„ ํ•˜๋‚˜ ๋งŒ๋“ค๊ณ  ์žˆ๋‹ค. ๋‹คํ–‰ํžˆ Unity ์—์„œ Git ์ €์žฅ์†Œ ์ •๋ณด๋ฅผ package.json ํŒŒ์ผ ์•ˆ์— ๋‹ด์•„์„œ ๊ทธ ํŒŒ์ผ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ •๋ณด๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค. (Unity Package Manager ์—์„œ Github ์— ์žˆ๋Š” ์˜คํ”ˆ ์†Œ์Šค๋ฅผ Git Url ๋กœ ๋‹ค์šด๋ฐ›์•„๋ณธ ์ ์ด ์žˆ์„ ๊ฒƒ์ด๋‹ค). Unity ์—์„œ ๊ถŒ์žฅํ•˜๋Š” Custom Package ๋ชจ์–‘์€ ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. Unity - Manual: Package layout Adding tests to a package Package layout This is the package layout recommended for custom packages: โ”œโ”€โ”€ package.jso..

[Unity] Url to Image (RawImage, UnityWebRequest, Couroutine, Action<Texture>)

์ด๋ฏธ์ง€ Url ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•ด์„œ ์ด๋ฏธ์ง€ Texture๋ฅผ ๋ณ€๊ฒฝํ•˜๋Š” ๋ฒ•์„ ์•Œ์•„๋ณด์ž. using System; using System.Collections; using TMPro; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; namespace Main { public class MainCard : MonoBehaviour { [SerializeField] private TextMeshProUGUI titleText; [SerializeField] private TextMeshProUGUI contentText; [SerializeField] private TextMeshProUGUI dateText; [SerializeField]..

[Unity] Json ๋กœ์ปฌ ๋ฐ์ดํ„ฐ ๋ถˆ๋Ÿฌ์˜ค๊ธฐ

JSON ์ง๋ ฌํ™” - Unity ๋งค๋‰ด์–ผ JsonUtility ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Unity ์˜ค๋ธŒ์ ํŠธ๋ฅผ JSON ํฌ๋งท์œผ๋กœ ์ƒํ˜ธ ์ „ํ™˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด JSON ์ง๋ ฌํ™”๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์›น ์„œ๋น„์Šค์™€ ์ƒํ˜ธ์ž‘์šฉํ•˜๊ฑฐ๋‚˜, ๋ฐ์ดํ„ฐ๋ฅผ ํ…์ŠคํŠธ ๊ธฐ๋ฐ˜ ํฌ๋งท์œผ๋กœ ์‰ฝ๊ฒŒ ํŒจํ‚น docs.unity3d.com json, xml ๋“ฑ ๋‹ค์–‘ํ•œ ํ˜•ํƒœ์˜ ๋ฐ์ดํ„ฐ ํฌ๋งท์ด ์žˆ๋‹ค. ๊ทธ ์ค‘ ๋ณด๊ธฐ๋„ ์ฒ˜๋ฆฌ๋„ ํŽธํ•œ Json ๋ฐ์ดํ„ฐ ํฌ๋งท์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฒ•์„ ์•Œ์•„๋ณด์ž. Json ํฌ๋งท์„ ์ง€์›ํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋Š” Unity ์—์„œ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” JsonUtility ํด๋ž˜์Šค, Newtonsoft์˜ Newtowsoft.json, Asset Store์—์„œ ๋‹ค์šด๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” JSON.NET(ํ˜„์žฌ ์ง€์›์ข…๋ฃŒ) ๋“ฑ์ด ์žˆ๋‹ค. ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ณ„๋กœ ์ง€์›ํ•˜๋Š” ๊ธฐ๋Šฅ์ด ๋‹ค๋ฅธ๋ฐ, ๊ฐ„๋‹จํ•œ..

[Unity] ๋ณ‘๋ชฉํ˜„์ƒ๊ณผ ๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ

๋ฉ”๋ชจ๋ฆฌ ์ตœ์ ํ™”๊ฐ€ ์™œ ํ•„์š”ํ•œ์ง€ ๊ทผ๋ณธ์ ์ธ ์›์ธ์„ ์•Œ์•„๋ณด์ž. #PC์˜ ๊ฒฝ์šฐ Storage(HDD, SSD, SD)์— ์žˆ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ CPU ๋ฉ”๋ชจ๋ฆฌ๋กœ ์˜ฌ๋ผ๊ฐ€๊ณ  ๊ทธ ์ค‘์— ๋ Œ๋”๋ง์ด ํ•„์š”ํ•œ(Texture, Shader ๋“ฑ) ๋ฐ์ดํ„ฐ๋ฉด GPU ๋ฉ”๋ชจ๋ฆฌ์— ์˜ฌ๋ผ๊ฐ€๊ฒŒ ๋œ๋‹ค. ์ด ๋•Œ PC๋Š” 64bit, 32bit๊ฐ€ ์กด์žฌํ•˜๋Š”๋ฐ 64bit = 2^64 = 16EB(์—‘์‚ฌ๋ฐ”์ดํŠธ) 32bit = 2^32 = 4GB ์˜ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๋งํ•œ๋‹ค. ์ฆ‰, ๋ฌผ๋ฆฌ์  PC ๊ธฐ๊ณ„์˜ ๋ฉ”๋ชจ๋ฆฌ๋Š” 10GB์ธ๋ฐ ๊ฒŒ์ž„์—์„œ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ 12GB๋ฅผ ์“ด๋‹ค๋ฉด, Storage์˜ ์ผ๋ถ€๊ณต๊ฐ„์„ ๊ฐ€์ƒ๋ฉ”๋ชจ๋ฆฌ๋กœ ์“ฐ๋Š” Swap Paging ์ด ์ผ์–ด๋‚œ๋‹ค. (๋” ๋งŽ์€ ๊ณต๊ฐ„์„ ์“ธ ์ˆ˜ ์žˆ๋„๋ก ์ง€์›ํ•˜๋Š” ๊ฒƒ) ์ด Swap Paging์ด ๋งŽ์ด ์ผ์–ด๋‚˜๋ฉด ๋ณ‘๋ชฉํ˜„์ƒ์ด ์ผ์–ด๋‚˜๋Š” ๊ฒƒ์ด๋‹ค. GPU Memory์—์„œ๋„ ๋ชจ..

[Unity] Garbage Collector

Resources.UnloadUnusedAssets(); GC.Collect(); https://jingonpark-gameclient.tistory.com/13 ๋Œ€ํ‘œ์ ์ธ Memory leak ๋ฐœ์ƒ ์œ ํ˜• Singleton static instance ๋”์ด์ƒ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” singleton๊ฐ์ฒด์˜ OnDestroy( )ํ•จ์ˆ˜์—์„œ ๋ฐ˜๋“œ์‹œ instance = null; ์ฒ˜๋ฆฌ๋ฅผ ํ•ด ์ฃผ์–ด์•ผ ํ•œ๋‹ค.๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด OnDestroy( ) ์ดํ›„์—๋„ ๊ฐ์ฒด๋Š” ๊ณ„์†ํ•ด์„œ ์‚ด์•„์žˆ๋‹ค. OnDestroy( )ํ•จ jingonpark-gameclient.tistory.com

[Unity] Asset, Library ์„ ํƒ ๊ธฐ์ค€

Asset ๋ฐ Library ์„ ํƒ ๊ธฐ์ค€์„ ์• ๋‹ˆ๋ฉ”์ด์…˜ Asset ํˆด์ธ DOTween๊ณผ iTween์œผ๋กœ ์•Œ์•„๋ณด์ž. DOTween (HOTween v2) | ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋„๊ตฌ | Unity Asset Store Use the DOTween (HOTween v2) tool from Demigiant on your next project. Find this & more animation tools on the Unity Asset Store. assetstore.unity.com iTween | ์• ๋‹ˆ๋ฉ”์ด์…˜ ๋„๊ตฌ | Unity Asset Store Use the iTween tool from Pixelplacement on your next project. Find this & more animation tools ..

[Unity] ํ”„๋กœ์ ํŠธ ์„ฑ๋Šฅ ํ™•์ธ ์ง€ํ‘œ, FPS(Frame Per Second)

FPS = 1 / TIme.deltaTime ์ดˆ๋‹น ํ”„๋ ˆ์ž„ ์ˆ˜ FPS(Frame Per Second)๋Š” ์„ฑ๋Šฅ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ์ง€ํ‘œ ์ค‘ ํ•˜๋‚˜์ด๋‹ค. ์ดˆ๋‹น ํ”„๋ ˆ์ž„ ์ˆ˜๊ฐ€ ๋งŽ์„ ์ˆ˜๋ก ๋”์šฑ ๋ถ€๋“œ๋Ÿฌ์šด ํ™”๋ฉด(์• ๋‹ˆ๋ฉ”์ด์…˜) ํšจ๊ณผ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์ฐธ๊ณ ๋กœ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ํ”„๋ ˆ์ž„์ด ๊ธ‰๊ฒฉํžˆ ๋–จ์–ด์ง€๋Š” ๊ฑธ ๋ณผ ์ˆ˜ ์žˆ๋Š”๋ฐ, ๊ทธ๋งŒํผ ์˜ค๋ธŒ์ ํŠธ ์ƒ์„ฑ์ด ๋ฌด๊ฑฐ์šด ์—ฐ์‚ฐ์ด๋ผ๋Š” ๋œป์ด๋‹ค. ์ฐธ๊ณ ) https://bloodstrawberry.tistory.com/795 ์œ ๋‹ˆํ‹ฐ - OnGUI๋กœ ์‹ค์‹œ๊ฐ„ ์ดˆ๋‹น ํ”„๋ ˆ์ž„ ์ˆ˜ ํ™•์ธํ•˜๊ธฐ (FPS Status based on OnGUI) Unity ์ „์ฒด ๋งํฌ ์ฐธ๊ณ  - OnGUI, ProfilerRecorder๋กœ ๋Ÿฐํƒ€์ž„ ๋“œ๋กœ์šฐ ์ฝœ ํ™•์ธํ•˜๊ธฐ ์ดˆ๋‹น ํ”„๋ ˆ์ž„ ์ˆ˜ FPS(Frame Per Second)๋Š” ์„ฑ๋Šฅ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ..

728x90