ãã®èšäºã§ã¯ãApple ã® Game Center ãšé£æºãããããã® Godot å ¬åŒãã©ã°ã€ã³ããããžã§ã¯ãã«è¿œå ããæ¹æ³ã«ã€ããŠèª¬æããŠããã§ã
ã¡ãªã¿ã«ãä»ãŸã§ã®èšäºã¯ãã§ããã調ã§æžããŠããããã©ãã¡ãã£ãšå èŠãããŠåãããã£ããããä»åãããå£èªèª¿ãšãããããããã£ããæ®æ®µã®ã¿ã¡èªã®é¢è¥¿åŒã§æžããŠããããšã«ããããããä»ãŸã§ã®èšäºãèªãã§ãããŠãã¿ããªã«ã¯ãããããŠããŸãããããããã©ããŸããæ®éã®æç« æžãããªã ChatGPT ã®ã»ããäžæã«æžããããããã¡ãã£ãšäººéãããåºããŠãããã£ãŠæãããããé¢è¥¿åŒã¢ã¬ã«ã®ãŒã®äººã¯ã»ããŸãŽã¡ã³ãã§ã
ãããã Game Center ã£ãŠäœïŒã£ãŠäººããããããããžããããç°¡åã«èª¬æããšãããªãiPhone ãšã iPad ãªããã® iOS ããã€ã¹äžã§ Apple ID 㧠Game Center ã«ãµã€ã³ã€ã³ããŠãããšãGame Center 察å¿ã®ã²ãŒã ããã¬ã€ãããšãã«ãäœããã®éæé ç®ãæŽæ°ããèšé²ãæ®ãããããªãŒããŒããŒãã§äžçäžã®ãã¬ã€ã€ãŒãšã¹ã³ã¢ã競ã£ããã§ãããããã²ãŒã éçºè ã¯ããã®éæé ç®ãäœã«ãããããããã®ã¯ãªã¢æ¡ä»¶ãã©ããããããªãŒããŒããŒãã§äœã競ããããããšãããããã®ãèšå®ã§ããã£ãŠãããã
ã»ãã§ãGodot ã§äœã£ãã²ãŒã ã§ããGodot å ¬åŒã® iOS ãã©ã°ã€ã³ã«å«ãŸããŠã Game Center ãã©ã°ã€ã³ã䜿ãã°ãå²ãšç°¡åã« Game Center æ©èœãçµã¿èŸŒããã£ãŠããããããªãæé«ããã
ã¡ãªã¿ã«ãå ¬åŒã®ããã¥ã¡ã³ããšãœãŒã¹ã³ãŒãã Godot iOS ãã©ã°ã€ã³ ãªããžã㪠ã«ããããããŸãã¯ãã£ã¡èŠãŠã¿ãŠãªãããã§ãã¡ãã£ãšãããããããšããããã£ãããŸããã®èšäºã«æ»ã£ãŠããŠã
èšäºäœæåœæã®çè ã®ç°å¢
Godot ã®ããŒãžã§ã³: 4.2.1
ã³ã³ãã¥ãŒã¿ã®ã¢ãã«: MacBook Air M1, 2020
OS: macOS 14.4.1
ãã©ã°ã€ã³ã®ãªããžããªãã¯ããŒã³ããã
åºæ¬çã«ã¯ããã® Github ã® Readme ã®æé ã«åŸãã°ãããããã©ããããŸã詳ããæžããŠãªãã£ãŠã¹ã ãŒãºã«ãããžãéšåãããããããã®èšäºã§ã¡ãã£ãšçŽ°ãããšããã説æããŠããããªãšæã£ãã®ãã
æå㯠GitHub ãªããžããªãšãã®ãµãã¢ãžã¥ãŒã«ãã¯ããŒã³ãããšãããããã§ãã¿ãŒããã«ïŒMacïŒãã³ãã³ãããã³ããïŒWindowsïŒãç«ã¡äžãããããŸãã¯ãªããžããªãã¯ããŒã³ãããå Žæã«ç§»åããšããªãããã¯ã²ãŒã ã®ãããžã§ã¯ããšã¯å¥ã®ãã©ã«ãã§ã倧äžå€«ãã§ãããããä»åŸããããªãããžã§ã¯ã㧠Game Center ãã©ã°ã€ã³ã䜿ããŸããããã£ããããããžã§ã¯ãå€ã®ã»ããããããšã¡ããããªã
ä»å㯠~/Godot/Plugins
ã£ãŠãã©ã«ããäœã£ãŠãããã«ç§»åããããšã«ãããã移åãããšã㯠cd
ã³ãã³ãããã
cd ~/Godot/Plugins
Change Directory
ã®ç¥ãããããã¡ãªã¿ã«ãåã¯ãäœã®ç¥ãããããªããšèŠããããªãã掟ãªããã§ãããããã®ããããè¿·æããããããã©ããã¡ãã¡èšã£ãŠãããã
移åã§ãããããã㧠GitHub ãªããžããªãšãã®ãµãã¢ãžã¥ãŒã«ãã¯ããŒã³ããã³ãã³ã git clone
ãå®è¡ããã--recursive
ã®ãªãã·ã§ã³ã¯æ¥æ¬èªã§ãååž°çãã£ãŠããèãæ
£ããžãèšèãªãããã©ãäžãŸã§å
šéšãã£ãŠæå³ã£ãœãã§ãããã§ã¯ãªããžããªã®äžã«ããã«ãµãã¢ãžã¥ãŒã«ã£ãŠããå¥ã®ãªããžããªããã£ãŠããããå«ããŠã¯ããŒã³ããã£ãŠæå³ããšæããã
ã¯ããŒã³ã£ãŠããã®ã¯ãSFæ ç»ãšãã®ãã¯ããŒã³äººéãã¿ããã«ãåããã®ãè€è£œããã£ãŠæå³ããããèŠããã«ã³ããŒããã£ãŠããšããããªãèŠãç®ã ããããªããŠãå èãŸã§å šéšãã®ãŸãŸã³ããŒããã¯ããŒã³äººéãäœããšæã£ãšãã°ãããã¡ããããªãç¥ãããã©ã
ã€ã³ã¿ãŒãããäžã®ãªããžããªã¯ããªã¢ãŒããªããžããªã£ãŠãããããã©ãã²ãŒã ããã¢ããªããä»åã¿ãããªãã©ã°ã€ã³ããã®ãããžã§ã¯ãã®ããŒã¿ããŸãšããŠçœ®ããŠããå Žæã¿ãããªãããã§ãããããŸãããšããŒã«ã«ïŒèªåã® PCïŒã«ã³ããŒããã£ãŠè©±ãããã®ã³ããŒããŠã§ããããŒã«ã«ã®ãªããžããªãããŒã«ã«ãªããžããªã£ãŠã¿ããªèšããŠããããã®ãŸããŸãããã£ãŠæããããªããããã§ã
git clone --recursive https://github.com/godotengine/godot-ios-plugins.git
ãã submodule ã®ã¯ããŒã³ã«å€±æããŠãšã©ãŒã衚瀺ããããã次ã®æé ãè©ŠããŠã¿ãŠãã
ãšãããã cd
ã³ãã³ãã§ã¯ããŒã³ããã°ããã®ããŒã«ã«ãªããžããªã«ç§»åããã§ã
cd godot-ios-plugins
ããããã次ã®ã³ãã³ããå®è¡ããŠã¿ãŠã
git submodule update --init
ã»ãã§æ¬¡ãªããªããžããªã®äžã® godot
ãµãã¢ãžã¥ãŒã«ã®ã¢ããããŒãããã£ãŠãã§ããŸã㯠godot
ãã©ã«ãã«ç§»åããŠãªã
cd godot
次ã«ãµãã¢ãžã¥ãŒã«ããã§ããããïŒãµãŒãããåã£ãŠããïŒãããã¿ãŒããã«ïŒã³ãã³ãããã³ããïŒã§ä»¥äžã®ã³ãã³ããå®è¡ããšãããšãã«ã¬ã¹ãã³ã¹ããªããŠäžå®ã«ãªãããããããã©ãæ°ã«ãããšããŠããšã©ãŒãåºããžããã£ããããã§ãªãã±ãŒããã
git fetch
ã»ãã§ä»äžãã¯ãgodot ãªããžããª
ã®ãã©ã³ãããèªåã䜿ã Godot ã®ããŒãžã§ã³ãšåããã©ã³ãåã確èªããŠãgit
ã® checkout
ã£ãŠãµãã³ãã³ãã§ãããŒã«ã«ã®ãµãã¢ãžã¥ãŒã«ããã®ããŒãžã§ã³ã®ãã©ã³ããšåãç¶æ
ã«ããããã§ã
# é圢
git checkout origin/<branch you want to use>
# äŸãã° 4.2 ã®ããŒãžã§ã³ãããã£ãããããªæã
git checkout origin/4.2
ã¡ãªã¿ã«ãããã©ã³ããã£ãŠæ¥æ¬èªã§ãæãã£ãŠæå³ãã§ããªããžããªã«ãããŠãããããžã§ã¯ãã«ã¯ããã€ãã®ããŒãžã§ã³ãããå Žåãå€ããã©ãå¥ããŒãžã§ã³ãäœããšãã«ã¡ã€ã³ã®å¹¹ããæåããããŠãã€ã¡ãŒãžããããã¡ãã£ãšããããããã©ãã
Godot header ãäœãã
次㫠Godot header ã£ãŠããã®ãäœã£ãŠããã§ãäœãœã¬ãããããã®ïŒãšãèšãããšããŠããiOS ã®ã¢ããªã£ãŠ Objective-C ãšã Swift ã£ãŠããããã°ã©ãã³ã°èšèªã§äœãããŠããããã©ãGodot ã®æ©èœããããã®èšèªã«å¯Ÿå¿ãããããã«å¿ èŠãªãã®ãªããã£ãŠãäœãœã¬ãããããã®ïŒ
ããããæ¹ã㊠godot
ãã©ã«ãã®äžã«ç§»åãããã
cd godot-ios-plugins/godot/
次ã«å®è¡ããã³ãã³ããã¡ãã£ãšã¯ã»ã¢ãããããReadme ã®æé ã«ã¯æ¬¡ã®ããã«æžããŠãããããã©…
scons platform=ios target=debug
target=debug
ã®æžãæ¹ãïŒãã¶ãå€ããŠïŒäœ¿ããžããããªãå®éã«ã¯æ¬¡ã®æ§ãªåœ¢ã«ä¿®æ£ããŠã³ãã³ãå©ããŠã¿ãŠãã
scons platform=ios target=editor
ã¡ãªã¿ã«ããã® Readme ã®èª¬æã©ããã«ãããªãåé¡ã«ã€ããŠã¯ããã®ããŒãž ãæçµçã«åèã«ãªã£ããããã·ã§ã¢ããšããã
次㫠.a ã®éçã©ã€ãã©ãªã£ãŠããã®ãäœã£ãŠãã§ããã£ãããã¡ã€ã³ã®ãªããžããªã«ãŸã移åããšããŠãªã
cd godot-ios-plugins
移åã§ãããã次ã®ã³ãã³ãã説æããŠããã§ã
æåã®è¡ã«ããã³ãã³ã㯠Readme ã«æžããŠãããã³ãã¬ãŒãïŒé圢ïŒã§ããã®äžã«åã® PC ã®å Žåã®ã³ãã³ããäŸãšããŠæžããŠãããåèã«ããŠãªã
åã® PC 㯠MacBook Air ã® M1 ãããïŒApple SiliconïŒããã arch
ãªãã·ã§ã³ã¯ arm64
ã«ãªããããªããã®ãžãã¯äœ¿ã£ãŠã PC ã«ãã£ãŠå€ãããããã°ã°ããªããChatGPTã«èããŠã¿ããããããããšãä»å㯠Game Center ãã©ã°ã€ã³ãè¿œå ãããããããã plugin=gamecenter
ã«ãªãã§ãæåŸã«ãä»èªåã䜿ã£ãŠã Godot ã®ããŒãžã§ã³ãæå®ãããããã©ãæè¿ã¯ã¿ã㪠4.x ç³»ããïŒéã£ãããŽã¡ã³ããã©ïŒããªã version=4.0
ã«ããã° OK ãã§ã
# é圢
scons target=<debug|release|release_debug> arch=<arch> simulator=<no|yes> plugin=<plugin_name> version=<3.x|4.0>
# äŸãã°ãããªæã
scons target=release_debug arch=arm64 simulator=yes plugin=gamecenter version=4.0
ããã .a ã©ã€ãã©ãªããã«ãããŠããã§ãå®äºããããã¡ã€ã³ã®ãªããžããªã®äžã«ãã bin
ãã©ã«ãå
ã«çèªããã§ã
# é圢
./scripts/generate_static_library.sh <plugin_name> <debug|release|release_debug> <godot_version>
# äŸãã°ãããªæã
./scripts/generate_static_library.sh gamecenter release_debug 4.0
次ã®ã³ãã³ãã§ã.xcframework ã©ã€ãã©ãªã£ãŠããã®ããã«ãããã§ãå®äºãããããã£ããšåãã bin ãã©ã«ãå ã« .a ãã¡ã€ã«ãå«ã .xcframework ãã©ã«ããçèªããã§ã
# é圢
./scripts/generate_xcframework.sh <plugin_name> <debug|release|release_debug> <godot_version>
# äŸãã°ãããªæã
./scripts/generate_xcframework.sh gamecenter release_debug 4.0
ãšããããšã§ããããŸã§ãã€ããããããã®ããšããããŸã§ã§äœã£ããã®ã Godot ã®ã²ãŒã ãããžã§ã¯ãã«ã¶ã£èŸŒãã§ãããã©ãããæ £ããªãã³ãã³ãæäœã§ç²ããŠããããŸãããè¶ã§ã飲ãã§ã¡ãã£ãšäŒæ©ããšããŠãã
Godotãããžã§ã¯ããžãã©ã°ã€ã³ãè¿œå ããã
åºæ¬çã«ãGodot å ¬åŒã®ä»¥äžã®æé ã«æ²¿ã£ãŠããã°ãããããã©ãã€ãŸãããã€ã³ããããããããã¯äŒããšããã
ãŸãæåã®ã€ãŸãããã€ã³ãã¯ãšãããšãGodot ã®ãããžã§ã¯ãã®äžã«ã¯ iOS ã®ãã©ã°ã€ã³ãã¶ã£èŸŒãå Žæã¯æåããã¯çšæãããŠãªãã£ãŠããšãããã ãããèªåã§ãã©ã«ãããããããªããããããèªåã® Godot ãããžã§ã¯ãã®ã«ãŒããã©ã«ãã«ãios/plugins
ãã©ã«ããäœã£ããããããäŸãã°ãã¹ã¯ãããã« my_game
ã£ãŠãããããžã§ã¯ãã®ãã©ã«ããããããã£ãã ~/Desktop/my_game/ios/plugins
ã¿ããã«ãªãã£ãŠããšãã§ã
ãã©ã°ã€ã³ãã¶ã£èŸŒãå ŽæïŒplugins
ãã©ã«ãïŒãã§ããããããã« godot-ios-plugins/plugins/gamecenter/gamecenter.gdip
ã£ãŠããæåãããªããžããªã«å
¥ã£ãŠããã¡ã€ã«ãš godot-ios-plugins/bin/gamecenter.release_debug.xcframework
ã£ãŠãã£ãã³ãã³ãå©ããŸãã£ãŠäœã£ããã©ã«ãã®2ã€ãããããã³ããããŠã¶ã£èŸŒãã ã£ãŠãã
ç¶ããŠãã€ãŸãããã€ã³ããã® 2 ãã§ãã²ãšã€æçŽããå¿
èŠããããã³ã¬ã»ããŸã«è¬ãªãããã©ããä»ãã£ãã³ãããã gamecenter.release_debug.xcframework
ãã©ã«ãã®ååã gamecenter.xcframework
ã«å€ããªãããããããããªããšããã®ããšããŸããããã®ããããŸããã£ãŠãããGodot ãè¿œå ãããã©ã°ã€ã³ãã¡ããŒããšèªèããŠãããããã
Exportã®èšå®ãããã
ãããããã©ã°ã€ã³è¿œå äœæ¥ã®ä»äžããã§ããããã Export ã®èšå®ãããŠããã§ããããã Godot ã觊ãæãæ¥ããªããŸããGodot ã®ãããžã§ã¯ããç«ã¡äžããããProject ã¡ãã¥ãŒ > Export… ãããšã¯ã¹ããŒãããã«ãéããŠãªããããŸã iOS çšã®ãšã¯ã¹ããŒãããªã»ãããäœã£ãŠãªãã£ãããããã«äžéšã® Add… ããæ°ãã iOS ã®ããªã»ãããäœã£ãŠãã
次㫠iOS ã®ããªã»ããã® Options ã¿ã㧠Plugins ã»ã¯ã·ã§ã³ãŸã§äžã«ã¡ããŒã£ãšã¹ã¯ããŒã«ããŠã¿ãŠããããããããã« Game Center ã®é ç®ã衚瀺ãããŠãã¯ããããã衚瀺ãããŠãžããã£ãããæ®å¿µããã©ãããŸã§ã®æé ã®ã©ããã§å€±æããŠãå¯èœæ§å€§ãã§ããã®å Žåã¯ãšããããã¡ãã£ãšãã³ããã©ãé©åœã«ç®æã€ããŠããçŽããŠã¿ãŠããç¡äºã« Game Center ã®é ç®ãããã°ããã§ãã¯å ¥ããŠæå¹ã«ããã°ãªãã±ãŒãã§ã
ããšãã€ãã§ããããã©ã Export ããã«ã®äžã®ã»ãã«ãã Export Path ã¯ãããžã§ã¯ãå€ã®å Žæãæå®ããã»ããããã§ããªãã§ãã£ãŠãããšããããžã§ã¯ãã®äžã« Export ãããããªããšããããé¡ã®äžã®é¡ã®äžã®é¡ã®äžã®…ã¿ãããªæãã«ãªãããïŒæå³ãããïŒãŸããResources ã¿ã㧠Export ã®ãšãã«é€å€ããããã¡ã€ã«ã®çš®é¡ãšãæå®ã§ããããããã§ãããã£ã¡ããããããã©ããŸãããã¯æ°æã¡ã®åé¡ããã
ãããã«
ãšããããšã§ãä»åã®ããŒãããããžã§ã¯ãã« Game Center ãã©ã°ã€ã³ãè¿œå ããããã¯ããã§ãããŸããã§ããããŸã§èªãã§ãããŠã»ããŸã«ããããšããåãå®éã« iOS ã®ã²ãŒã éçºããŠããšãã«ã¡ãã¡ãã£ãšæžãçããã¡ã¢ãããŒã¹ã«ãã®èšäºæžããŠããããéäžã§äœãã¡ã¢ãæããŠããããŠãããŸãããããšãããã£ããããããããããã©ãããããã®èŠã€ããã X ãšãã§ããããæããŠãããããã¡ããã¡ãå©ããããããã§ãã
ã²ãŒã ã®å®£äŒ
æåŸã«ãå®éã« Game Center ãã©ã°ã€ã³ã䜿ã£ãŠããåã®ã²ãŒã ã®å®£äŒã ããããŠãããžãïŒããããããã
ð¹ ãã®åãäŸ
ä»ããªãã®åäœèŠåãšåå°ç¥çµãè©ŠãããïŒäŸãæäœããŠã空ããéã£ãŠãããããªç©ããããªç©ãèŠäºç©ºäžã§åãããšãã§ãããïŒïŒç°¡åçææäœã§ãã¬ã€ã§ãããæ¿ãããå¿ è³ã®çœå¿«ã«ãžã¥ã¢ã«ã»ã¿ã€ãã³ã°ã²ãŒã ïŒ
ð ã¹ãããªãœãªãã£ã¢
ããœãªãã£ã¢ïŒã¯ãã³ãã€ã¯ïŒããšèšãã°ãèšãããšç¥ããå®çªäžã®å®çªãäžäººéã³ã«ãŒãã²ãŒã ã®çæ§ãªããã§ããããã®ãã³ãã¢ãã€ã«ã²ãŒã ãã¹ãããªãœãªãã£ã¢ãã App Store ã§é ä¿¡äžïŒ
â£ïž ã¯ã€ãã¯ãã³ãããŒã«ãŒ
ã«ãžãã§äººæ°ã®å®çªã«ãŒãã²ãŒã ãšèšãã°ãããŒã«ãŒã§ãããã¢ãã€ã«ã«ãžã¥ã¢ã«ã²ãŒã ãã¯ã€ãã¯ãã³ãããŒã«ãŒããšããŠãããºã«ã²ãŒã ã«ãªããŸãããæäœã¯ç°¡åãã§ããã ãçŽ æ©ãã«ãŒããã¿ããããããããããŒã«ãŒã®åœ¹ãæããã ãïŒApp Store ã§é ä¿¡äžïŒ