ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2024ǯ03·î18Æü(·î) 21:11:55ÍúÎò
¡¡¥»¡¼¥Ö¡¦¥í¡¼¥É¤ÎÂÐ¾Ý¤Ï GameData ¥¯¥é¥¹¤È¤·¤Þ¤¹¡£
Unity ¤Î¥»¡¼¥Ö¡¦¥í¡¼¥Éµ¡Ç½¤Ï PlayerPrefs ¥¯¥é¥¹¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤Î¥¯¥é¥¹¤Ç¤Ï¥¯¥é¥¹Á´ÂΤò¥»¡¼¥Ö¡¦¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¡£
¡¡Âå¤ï¤ê¤Ë Newtonsoft ¤è¤êÄ󶡤µ¤ì¤Æ¤¤¤ë JsonConvert ¥¯¥é¥¹¤òÍøÍѤ·¤Æ¡¢GameData ¤ò¤Þ¤È¤á¥»¡¼¥Ö¡¦¥í¡¼¥É¤Ç¤¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤³¤ì¤Ï GameData ¥¯¥é¥¹¤ò¥·¥ê¥¢¥é¥¤¥º¤·¤Æʸ»úÎó¾ðÊó¤ËÃÖ¤´¹¤¨¡¢¤½¤ì¤ò¥»¡¼¥Ö¡¦¥í¡¼¥É¤¹¤ë¤³¤È¤Ç¼Â¸½¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤Þ¤º¤Ï Newtonsoft ¤Î¥é¥¤¥Ö¥é¥ê¤ò¥¤¥ó¥Ý¡¼¥È¤·¡¢¤½¤ì¤ò³èÍѤ·¤¿¥¯¥é¥¹¤òÍÑ°Õ¤·¤Þ¤¹¡£
¡¡
¡¡¼¡¤Î¼ê½ç¤Ç¤Ï¡¢GameData ¥¯¥é¥¹¤ò¥Ô¥å¥¢¥¯¥é¥¹¤ËÊѹ¹¤·¡¢¥·¥ê¥¢¥é¥¤¥º²Äǽ¤Ê¾õÂ֤˾õÂ֤ˤ·¤Þ¤¹¡£
¡¡GameData ¥¯¥é¥¹¤ò¥Ô¥å¥¢¥¯¥é¥¹¤ËÊѹ¹¤·¡¢¥¯¥é¥¹Á´ÂΤò¥»¡¼¥Ö¤Ç¤¤ë¾õÂ֤ˤ·¤Þ¤¹¡£
¤¿¤À¤·¡¢GameData ¤Ï¥·¥ó¥°¥ë¥È¥ó¥¯¥é¥¹¤Ç¤¢¤ê¡¢¤½¤Î¤Þ¤Þ¤Ç¤¹¤È GameData ¤Ø¤Î»²¾È¤¬¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤ÉÔÊؤǤ¹¡£
¤½¤³¤Ç¿·¤·¤¯ GameDataManager ¥¯¥é¥¹¤ò¥·¥ó¥°¥ë¥È¥ó¥¯¥é¥¹¤È¤·¤ÆºîÀ®¤·¡¢¤½¤ÎÃæ¤Ç GameData ¥¯¥é¥¹¤ò´ÉÍý¤¹¤ë¤è¤¦¤ËÀ߷פòÊѹ¹¤·¤Þ¤¹¡£
¡¡¤³¤Î¾õÂ֤ˤ¹¤ë¤³¤È¤Ç¡¢GameData ¤Ë¤Ä¤¤¤Æ¤Ï¡¢GameDataManager ¤òÄ̤¸¤Æ¥¢¥¯¥»¥¹¤¹¤ë¾õÂÖ¤òºî¤ê¤À¤·¡¢
¤¤¤Þ¤Þ¤Ç¤ÈƱ¤¸¤è¤¦¤Ë¥·¥ó¥°¥ë¥È¥ó¤Î¤è¤¦¤Ë¤É¤³¤Î¥¯¥é¥¹¤«¤é¤Ç¤â»²¾È¤Ç¤¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¤³¤Á¤é¤Îµ»ö¤ò»²¹Í¤Ë¡¢Newtonsoft.Json ¥é¥¤¥Ö¥é¥ê¤ò¥¤¥ó¥Ý¡¼¥È¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡https://qiita.com/kazuma_f/items/55a0b7ff628ab596e...
¡¡static ¥¯¥é¥¹¤È¤·¤Æ PlayerPrefsHelper ¥¯¥é¥¹¤òºîÀ®¤·¤Þ¤¹¡£
¤³¤ì¤Ï Unity ¤Î PlayerPrefs ¥¯¥é¥¹¤Î³Æµ¡Ç½¤òÍøÍѤ·¤ä¤¹¤¤¤è¤¦¤ËÊñ³çŪ¤Ë´ÉÍý¤·¤Æ¤¤¤ë¥Ø¥ë¥Ñ¡¼¥¯¥é¥¹¤Ç¤¹¡£
¡¡¤³¤Î¥¯¥é¥¹Æâ¤ËÍÑ°Õ¤¹¤ë¥á¥½¥Ã¥É¤Ë¤ª¤¤¤Æ JsonConvert ¥¯¥é¥¹¤òÍøÍѤ·¡¢
GameData ¥¯¥é¥¹¤ò£±¤Ä¤Î¾ðÊó¤È¤·¤Æ¤Þ¤È¤á¤Æ¥»¡¼¥Ö¡¦¥í¡¼¥É¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
PlayerPrefsHelper.cs
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯