ZEPETO Players
- ZepetoPlayers ã¯ãZEPETOãã¬ã€ã€ãŒãšZEPETOãã£ã©ã¯ã¿ãŒã®äž¡æ¹ãå¶åŸ¡ããããã«èšèšããããããŒãžã£ãŒïŒã·ã³ã°ã«ãã³ïŒã¯ã©ã¹ã§ãã
- ZepetoPlayersãã·ãŒã³ã«è¿œå ããããšã§ãZEPETOãã¬ã€ã€ãŒãäœæãåé€ãæäœã§ããŸãã
- ZepetoPlayer ã¯ããã«ããã¬ã€ã€ãŒã®äžçã§çŽæ¥å¶åŸ¡ãããã¬ã€ã€ãŒãšä»ã®ãã¬ã€ã€ãŒã管çããããã«äœ¿çšãããZEPETOãã£ã©ã¯ã¿ãŒã®åå¥ã®ã€ã³ã¹ã¿ã³ã¹ãè¡šããŸãã
- ãã«ããã¬ã€ã€ãŒã®äžçã§äœæããããã¹ãŠã®ZepetoPlayerã«ã¯äžæã®ã»ãã·ã§ã³IDãå²ãåœãŠããããã®ã»ãã·ã§ã³IDã䜿çšããŠç®¡çãããŸãã
- ZepetoPlayerã¯ZepetoCharacterã®å±æ§ãæã£ãŠãããããZepetoCharacterã«é¢é£ããé¢æ°ã䜿çšããŠå¶åŸ¡ã§ããŸãã
- ZepetoPlayerã«ã¯3çš®é¡ããããŸãïŒ
ZepetoPlayer | 説æ |
---|---|
ããŒã«ã«ãã¬ã€ã€ãŒ | ããŒã«ã«ãŠãŒã¶ãŒã«ãã£ãŠçŽæ¥å¶åŸ¡ãããZEPETOãã£ã©ã¯ã¿ãŒã€ã³ã¹ã¿ã³ã¹ã§ãã - ãã£ã©ã¯ã¿ãŒã³ã³ãããŒã©ãŒ/Zepetoã«ã¡ã©ã³ã³ããŒãã³ããä»å±ããŠããŸãã |
ãããã¯ãŒã¯ãã¬ã€ã€ãŒïŒãªã¢ãŒããã¬ã€ã€ãŒïŒ | ãã«ããã¬ã€ã³ã³ãã³ãã§èªã¿èŸŒãã§å©çšã§ããZEPETOãã£ã©ã¯ã¿ãŒã€ã³ã¹ã¿ã³ã¹ã§ãã - ãã£ã©ã¯ã¿ãŒã³ã³ãããŒã©ãŒ/Zepetoã«ã¡ã©ã³ã³ããŒãã³ãã¯ä»å±ããŠããŸããã |
ããããã¬ã€ã€ãŒ | ãã«ããã¬ã€ã³ã³ãã³ãçšã®ZEPETOãã£ã©ã¯ã¿ãŒã€ã³ã¹ã¿ã³ã¹ã§ãããå®éã®ãŠãŒã¶ãŒã§ã¯ãªããããã«ãã£ãŠå¶åŸ¡ãããŸãã ãã¬ã€ã€ãŒãäžè¶³ããŠããç¶æ ã§ãã«ããã¬ã€ã€ãŒã¯ãŒã«ããéå§ããéãããã¬ã€ã€ãŒããã¬ã€äžã«éåºããå Žåã®ä»£æ¿ãšããŠäœ¿çšãããŸãã - ãã£ã©ã¯ã¿ãŒã³ã³ãããŒã©ãŒ/Zepetoã«ã¡ã©ã³ã³ããŒãã³ãã¯ä»å±ããŠããŸããã |
- 以äžã®ã¬ã€ããåç §ããŠãã ããã
- ZepetoCharacter ã¯ãWorld Sceneã§èªã¿èŸŒãã§å¶åŸ¡ã§ããZEPETOãã£ã©ã¯ã¿ãŒã®åºæ¬ã€ã³ã¹ã¿ã³ã¹ãŠãããã§ãã
- ZepetoCharacterã¯ãZEPETOã¢ããªãéããŠäœæãããã¢ãã¿ãŒã®å€èŠãæã£ãŠããŸãã
HierarchyãŠã£ã³ããŠã§ãZEPETO â ZepetoPlayersã¿ããéžæããŸãã
ã·ãŒã³ã«è¿œå ã§ããããã«ãªããŸããã
ZepetoPlayersãè¿œå ããã ãã§ã¯ãZepeto Playerãã·ãŒã³ã«æã¡èŸŒãããšã¯ã§ããŸãããZepetoPlayersã®ãã£ã©ã¯ã¿ãŒäœæAPIã䜿çšããŠã¹ã¯ãªãããå®è£ ããå¿ èŠããããŸãã
ã·ãŒã³ã§ããŒã«ã«ãã¬ã€ã€ãŒã ããè¿ éã«äœæããŠè©Šãããå Žåã¯ãã¬ã€ããåç §ããŠãã ããïŒ

Zepetoãã¬ã€ã€ãŒã®ååãšãããã£ãŒã«åçã衚瀺ããæ¹æ³ã®ãµã³ãã«ã«ã€ããŠã¯ãã¬ã€ããåç §ããŠãã ããïŒ

ZepetoPlayers APIã«èå³ãããå Žåã¯ãããã¥ã¡ã³ããåç §ããŠãã ããïŒ

ãã®ã¬ã€ãã¯ãäž»ã«ãã«ããã¬ã€ã€ãŒã·ããªãªã§ã®ZEPETOãã¬ã€ã€ãŒã®äœ¿çšäŸãã«ããŒããŠããŸãã

ã·ã³ã°ã«ãã¬ã€ã€ãŒã®äžçã§ã¯ãããŒã«ã«ãã¬ã€ã€ãŒãäœæããå¿ èŠããããããŒã«ã«ãã¬ã€ã€ãŒã®ã¿ãç»é¢ã«è¡šç€ºããããããåæã¯äžèŠã§ãã
ãããããã«ããã¬ã€ã®äžçã§ã¯ãçŽæ¥æäœããããŒã«ã«ãã¬ã€ã€ãŒã ãã§ãªãããããã¯ãŒã¯ãã¬ã€ã€ãŒãšåŒã°ããä»ã®ãã¬ã€ã€ãŒãç»é¢ã«è¡šç€ºããå¿ èŠããããŸãã
ãããã¯ãŒã¯ãã¬ã€ã€ãŒã®ãã¹ãŠã®ã¢ã¯ã·ã§ã³ - 移åããžã£ã³ããç¹å®ã®ãžã§ã¹ãã£ãŒãè¡ã - ã¯ãããªãã®ç»é¢ã«åãããã«è¡šç€ºãããå¿ èŠããããŸãã
ãã®ããã»ã¹ã¯åæãšåŒã°ããŸãã
åæã¹ã¯ãªãããå®è£ ããªããšããããã¯ãŒã¯ãã¬ã€ã€ãŒã®å€èŠãåããèŠãããšãã§ããŸããã
åæãªãã®ãã«ããã¬ã€ã¯ãŒã«ãã§ã¯ãä»ã®ã¯ã©ã€ã¢ã³ããã«ãŒã ã«å ¥ã£ããã©ãããç¥ãå¯äžã®æ¹æ³ã¯ããŒã ãã¿ã³ãéããŠã§ãã

ãã«ããã¬ã€ãã¥ãŒããªã¢ã«ãããªãéããŠãåºæ¬èšå®ãšæŠå¿µãç解ããããšããå§ããããšããå§ãããŸãã
- 以äžã®ã¬ã€ããåç §ããŠãã ããã

ããªãã®ããŒã«ã«ãã¬ã€ã€ãŒã¯ãä»ã®èª°ãã®ããã€ã¹äžã§ãããã¯ãŒã¯ãã¬ã€ã€ãŒãšããŠæ±ãããŸãã
ããã¯ãããªãã®ããŒã«ã«ãã¬ã€ã€ãŒãåæã®ããã«ãµãŒããŒã«æ å ±ãéä¿¡ããªããã°ãªããªãããšãæå³ããŸãã
ãã«ããã¬ã€ã¯ãŒã«ãã«æ¥ç¶ãããŠãããã¹ãŠã®ãã¬ã€ã€ãŒã¯ãèªåã®æ å ±ãå ±æããå¿ èŠããããŸãã
ãã«ããã¬ã€ã«ãŒã ã«æ¥ç¶ãããŠãããã¹ãŠã®ã¯ã©ã€ã¢ã³ãã¯ããã«ããã¬ã€ã«ãŒã ã®ç¶æ ããŒã¿ãå ±æããŸãã
ãã®ã«ãŒã ç¶æ ããŒã¿ã¯ãSchemas.jsonã§å®çŸ©ãããã¹ããŒãã«åŸããŸãã
ïŒã¹ããŒããããŒã¿æ§é ãšããŠèæ ®ããŠãã ããïŒ
ãã®ã¬ã€ãã§ã¯ãã«ãŒã ã¹ããŒãããŒã¿ãéããŠãã¬ã€ã€ãŒã®äœçœ®ãåæããŸãããããã£ãŠãåãã¬ã€ã€ãŒã®äœçœ®ããŒã¿ãè¡šãããšãã§ããã¹ããŒããSchemas.jsonã«å®çŸ©ããŠãã ããã

ð ãã³ã
- ãµãŒããŒãšãã¹ãŠã®ã¯ã©ã€ã¢ã³ããå ±æãã¹ãæ å ±ããã¹ãŠããã«ããã¬ã€ã«ãŒã ã¹ããŒãã«ä¿åããŠãã ããã
- ã¬ãã«ãçµéšå€ãã¹ã³ã¢ãªã©ãåãã¬ã€ã€ãŒã®åå¥ããŒã¿ãä¿åããã«ã¯ãããŒã¿ã¹ãã¬ãŒãžã䜿çšããŠãã ããã

ãµãŒããŒã¹ã¯ãªããã¯ãå¥ã®ãã¬ã€ã€ãŒãã«ãŒã ã«å ¥ã£ããšãã«ãããèªèãããã®æ å ±ãã¯ã©ã€ã¢ã³ãã«éä¿¡ããŠããã®ãã¬ã€ã€ãŒãã·ãŒã³ã«ããŒãããããšãã§ããŸãã

ãã¬ã€ã€ãŒããã«ããã¬ã€ã¯ãŒã«ãã®ã«ãŒã ã«å ¥ããšãonJoin()ãåŒã³åºãããŸãã
ãµãŒããŒã¹ã¯ãªããã§ã¯ãæ¥ç¶ããããã¬ã€ã€ãŒã®æ å ±ãã«ãŒã ã¹ããŒãã®ãã¬ã€ã€ãŒã«è¿œå ããŸãã

ãŸãããã¬ã€ã€ãŒãã«ãŒã ãéåºãããšãonLeave()ãåŒã³åºãããŸãã
ãµãŒããŒã¹ã¯ãªããã¯ãã«ãŒã ã¹ããŒãã®ãã¬ã€ã€ãŒããéåºãããã¬ã€ã€ãŒã®æ å ±ãåé€ããŸãã

ãã«ããã¬ã€ã¯ãŒã«ããäœæããéã«ã¯ããµãŒããŒãšéä¿¡ããããã®ã¯ã©ã€ã¢ã³ãã¹ã¯ãªãããå¿ èŠã§ãã
以äžã¯ããã«ããã¬ã€çšã®åºæ¬çãªã¯ã©ã€ã¢ã³ãã¹ã¯ãªããã®äŸã§ãã
ã¯ã©ã€ã¢ã³ãåŽã§ã¯ãcurrentPlayersãããããŒã¿æ§é ã䜿çšããŠã衚瀺ãããã¬ã€ã€ãŒããŒã¿ã管çããŸãã

以äžã«éèŠãªã³ãŒãã®è¡ã瀺ããŸãïŒ
ZepetoPlayers.instance.CreatePlayerWithUserId(sessionId, player.zepetoUserId, spawnInfo, isLocal);
ã¯ã©ã€ã¢ã³ãããµãŒããŒã®ã«ãŒã ã¹ããŒããããã¬ã€ã€ãŒæ å ±ãåä¿¡ããæ°ãããã¬ã€ã€ãŒãã«ãŒã ã«åå ãããšãã»ãã·ã§ã³IDãå²ãåœãŠãããŸããäœæããããã¬ã€ã€ãŒã®ã»ãã·ã§ã³IDãèªåã®ã»ãã·ã§ã³IDãšäžèŽããå Žåããã®ãã¬ã€ã€ãŒã¯ããŒã«ã«ãšèŠãªãããŸãããã®å Žåããã¬ã€ã€ãŒã¯æ¬¡ã®ããã«ã€ã³ã¹ã¿ã³ã¹åãããŸãïŒisLocal = true, ããã¯ããŒã«ã«ãã¬ã€ã€ãŒã§ããããšã瀺ããŠããŸãã
ãã®åŸãããŒã«ã«ã§ãªããã¬ã€ã€ãŒã¯ isLocal = false. ããã«ãããããŒã«ã«ãã¬ã€ã€ãŒãšéããŒã«ã«ãã¬ã€ã€ãŒã®ãã¹ãŠã®å€èŠ³ãç»é¢ã«è¡šç€ºãããããšãä¿èšŒãããŸãã

ä»ããã¬ã€ã€ãŒãå ¥ããšãZEPETOãã£ã©ã¯ã¿ãŒãç»é¢ã«äœæãããããšã確èªã§ããŸãã
ãããããã¬ã€ã€ãŒã®åãã¯ãŸã ç»é¢ã«åæ ãããŠããŸããã

次ã«ãäœçœ®ã®åæã«é²ã¿ãŸãããã

åæã®ããã«ããã¬ã€ã€ãŒãåãããã¢ã¯ã·ã§ã³ãåã£ãããããã³ã«ã圌ãã¯ãµãŒããŒã«ç¶æ ã®å€åãéä¿¡ããªããã°ãªããŸããã
ç¶æ ã®å€åãå«ãã¡ãã»ãŒãžããµãŒããŒã«éä¿¡ããã®ã¯ãã«ãŒã ã¡ãã»ãŒãžéä¿¡ãéããŠè¡ãããŸãã
ãµãŒããŒããã¬ã€ã€ãŒã®ç¶æ å€åã«é¢ããã¡ãã»ãŒãžãåä¿¡ãããšãã«ãŒã ã®ç¶æ ãæŽæ°ãããŸãã

äŸãã°ãããªãã®ããŒã«ã«ãã¬ã€ã€ãŒãBãšããååã ãšããŸãããã
ãããã¯ãŒã¯ãã¬ã€ã€ãŒAãã«ãŒã ã«åå ãããšã圌ãã¯åº§æšx:0, y:0, z:0ã§ã€ã³ã¹ã¿ã³ã¹åãããŸãã
ãã¬ã€ã€ãŒAãäœçœ®x: -10, y: 0, z: 0ã«ç§»åãããšãBã¯Aã移åããŠããããšãç¥ãæ¹æ³ãå®éã«ã¯ãããŸããã
ããã¯ãäž¡è ãå¥ã ã®ããã€ã¹ã§ããŒã«ã«ã«æäœãããŠãããããå¥ã ã®ã¯ã©ã€ã¢ã³ãã§ããããã§ãã
ãããã£ãŠãAãæäœããŠãã人ã¯ãã«ãŒã ã¡ãã»ãŒãžãä»ããŠãµãŒããŒã«èªåã®åããäŒããå¿ èŠããããŸãã
ãµãŒããŒããã®æ å ±ãåãåããšãã«ãŒã å ã®å šå¡ã«Aã®ãªã¢ã«ã¿ã€ã ã®äœçœ®ãéç¥ããŸããããã«ãããBã¯ã€ãã«Aã移åããŠããããšãèªèããŸãã
ãµãŒããŒãä»ã®ãã¬ã€ã€ãŒã«éç¥ããããã«ã¯ã2ã€ã®æ¹æ³ããããŸãïŒ
- ã«ãŒã ã¡ãã»ãŒãžã®ãããŒããã£ã¹ãã䜿çšããã
- ã«ãŒã ã®ç¶æ ãæŽæ°ãããã®åŸã¯ã©ã€ã¢ã³ããã«ãŒã ã®ç¶æ ãååŸããŠé©çšããã
ãã®ã¬ã€ãã§ã¯ãã«ãŒã ã®ç¶æ ãæŽæ°ãã2çªç®ã®æ¹æ³ãå©çšããŸãã

ã·ãŒã³ã«ããŒããããZepetoãã¬ã€ã€ãŒãZepetoãã£ã©ã¯ã¿ãŒå±æ§ãæã£ãŠãããããç¹å®ã®å Žæãžã®ç§»åããžã£ã³ããæ瀺ããããã«Zepetoãã£ã©ã¯ã¿ãŒæ©èœã䜿çšã§ããŸãã
Bã®ã¯ã©ã€ã¢ã³ããAã®ç§»åãx:-10, y:0, z:0ã«èŠèŠåããããã®æãçŽæçãªã¢ãããŒãã¯ãMoveToPosition()ã䜿çšããããšã§ãããã®é¢æ°ã¯ããµãŒããŒããåä¿¡ããAã®ææ°ã®äœçœ®ã«ãã¬ã€ã€ãŒã移åãããŸãã
äœçœ®ã®å€æŽã ãã§ãªãããžã§ã¹ãã£ãŒãã¹ãã«ã®äœ¿çšãã¢ã€ãã ã®åéããã¹ãŠã®ç¶æ å€æŽã¯ãåæã®ããã«ãµãŒããŒãšã¯ã©ã€ã¢ã³ãã®éä¿¡ãå¿ èŠãšããŸãã
ãããã¯ãŒã¯å šäœã§å šãŠã®ã¢ã¯ã·ã§ã³ã調åãããããã«ãåæãå®è£ ããå¿ èŠããããŸãã
ð åæã®æŠå¿µã®æŠèŠ
- ããŒã«ã«ãã¬ã€ã€ãŒã«ã¹ããŒã¿ã¹å€æŽããããšãRoom Messageã䜿çšããŠãµãŒããŒã«éä¿¡ããŸãã
- ãµãŒããŒã¯ãããŒã«ã«ãã¬ã€ã€ãŒãé€ããã¹ãŠã®ä»ã®ãã¬ã€ã€ãŒã«ã¹ããŒã¿ã¹å€æŽãéç¥ããŸãã
- ã¹ããŒã¿ã¹å€æŽã¡ãã»ãŒãžãåä¿¡ãããšãã¯ã©ã€ã¢ã³ãã³ãŒãã¯ã¡ãã»ãŒãžãéä¿¡ãããã¬ã€ã€ãŒã®ã¹ããŒã¿ã¹ãæŽæ°ããŸãã

åºæ¬çãªãµãŒããŒã¹ã¯ãªããã§ã¯ãããŒã«ã«ãã¬ã€ã€ãŒã®ã¯ã©ã€ã¢ã³ãããã®ã¹ããŒã¿ã¹å€æŽã«é¢ããã¡ãã»ãŒãžãåä¿¡ãããã³ã«ãã«ãŒã ã®ç¶æ ãæŽæ°ããããã®è¿œå ã®å®è£ ãå¿ èŠã§ãã

åºæ¬çãªã¯ã©ã€ã¢ã³ãã¹ã¯ãªããã«ãããéèŠãªå®è£ ã¯æ¬¡ã®ãšããã§ãïŒ
- ãµãŒããŒã®ã«ãŒã ã¹ããŒããå€æŽããããšãã«OnStateChangeãèªåçã«åŒã³åºããŸãã
- ã䜿çšããŠãSendMessageLoop(0.04)é¢æ°ã䜿çšããŠãããŒã«ã«ãã¬ã€ã€ãŒã®äœçœ®ãšãã£ã©ã¯ã¿ãŒã®ãžã£ã³ãç¶æ æ å ±ããµãŒããŒã«0.04ç§ããšã«éä¿¡ããŸãã


ð ãã³ã
- ãã®ã¬ã€ãã¯äœçœ®ã®åæã®ã¿ãå®è£ ããŠããŸãããžã§ã¹ãã£ãŒã®åæããªããžã§ã¯ãã®åæãªã©ã¯å®è£ ãããŠããŸããã
- ååã¯ãã¹ãŠåãã§ãããå¿ èŠãªç¬éã«ã«ãŒã ã¡ãã»ãŒãžãéåä¿¡ããããã»ã¹ãå¿ èŠã§ãã
- åæããã䟿å©ã«å®è£ ãããå Žåã¯ããã«ããã¬ã€åæã¢ãžã¥ãŒã«ã®äœ¿çšãæ€èšããŠãã ããã