유니티(unity)
[unity/c#]IniParser를 활용하여 ini를 외부 Config파일로 활용하기
개발자 고포고
2022. 1. 20. 16:45
반응형
#IniParser를 어셋 스토어에서 받는다.
https://assetstore.unity.com/packages/tools/advanced-ini-parser-23706
Advanced INI Parser | 도구 | Unity Asset Store
Get the Advanced INI Parser package from Project Boon and speed up your game development process. Find this & other 도구 options on the Unity Asset Store.
assetstore.unity.com
StreamingAssets폴더에 config.ini 파일을 만든다.
#config.ini
[Section]
Width=1920
Height=1080
ItemCode=A
#Bihind Code
INIParser ipParser = new INIParser();
ipParser.Open(path);
var width = ipParser.ReadValue("Section", "Width",0);
var height = ipParser.ReadValue("Section", "Height", 0);
Screen.SetResolution(width, height, true);
#그러면 외부에서 ini 파일을 변경하여 해상도를 변경 할 수 있다.
#c# #ini #config #settings #setting #컨피그 #유니티 #unity
반응형