ºÇ½ª¹¹¿·¡§
orika_ex_miyako 2022ǯ12·î08Æü(ÌÚ) 21:20:58ÍúÎò
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡°Ê²¼¤ÎÆâÍƤǽçÈ֤˼ÂÁõ¤ò¿Ê¤á¤Æ¤¤¤¤Þ¤¹¡£
¼ê½ç£¹¡¡¡¼¥¥ã¥é¥¯¥¿¡¼¤Î¥¢¥Ë¥á¡¼¥·¥ç¥óÁ«°ÜÍѤΥ¹¥¯¥ê¥×¥È¤ÎºîÀ®¡¼
£±£²¡¥PlayerAnimation ¥¹¥¯¥ê¥×¥È¤ÎºîÀ® £±£³¡¥PlayerNavigationController ¥¹¥¯¥ê¥×¥È¤Î½¤Àµ
¡¡¥×¥ì¥¤¥ä¡¼ÍѤΥ¥ã¥é¥¯¥¿¡¼¤Î¥¢¥Ë¥á¡¼¥·¥ç¥óÁ«°Ü¤òÀ©¸æ¤¹¤ë¥¯¥é¥¹¤òºîÀ®¤·¤Þ¤¹¡£
ÈÆÍÑŪ¤Ê¥¯¥é¥¹¤òºîÀ®¤¹¤ë¤³¤È¤òÌÜŪ¤È¤·¤ÆÀ߷פ¹¤ë¤³¤È¤Ç¡¢¥×¥ì¥¤¥ä¡¼ÍѤΥ¥ã¥é¤À¤±¤Ç¤Ï¤Ê¤¯¡¢
Ũ¥¥ã¥é¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÀ©¸æ¤Ë¤âÍøÍѤ¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢³Æ¥¥ã¥é¥¯¥¿¡¼¤ÎÀ©¸æÍѤΥ¯¥é¥¹(PlayerController ¤Ê¤É)¤Ë¤Ï¥¢¥Ë¥á¡¼¥·¥ç¥óÀ©¸æ¤Î½èÍý¤Ïµ½Ò¤»¤º¡¢
¿·¤·¤¤ÀìÍѤΥ¯¥é¥¹¤òºîÀ®¤·¤Æ¡¢¿§¡¹¤Ê¥¥ã¥é¥¯¥¿¡¼¤ËÂбþ¤Ç¤¤ë¤è¤¦¤ÊÀ߷פò¹Ô¤¤¤Þ¤¹¡£
¡¡enum(¥¤¥Ë¥å¡¼¥à)¤È¤Ï C# ¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¹½Â¤ÂΤËʬÎव¤ì¤ëµ¡Ç½¤Î£±¤Ä¤Ç¤¹¡£Îóµó(¤ì¤Ã¤¤ç)·¿¤È¸Æ¤Ð¤ì¤Þ¤¹¡£
¡¡bool ·¿¤òÍøÍѤ¹¤ë¤È if ʸ¤Ë¤ª¤¤¤Æ£²¤Ä¤Îʬ´ô¥Ñ¥¿¡¼¥ó¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¤Ç¤¹¤¬ bool ·¿¤Ë¤Ï true/false ¤Î£²¤Ä¤Î¾õÂÖ¤·¤«ÃͤȤ·¤Æ»ý¤¿¤Ê¤¤¤¿¤á¡¢£³¤Ä°Ê¾å¤Î¾õÂÖ¤ò´ÉÍý¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
¡¡¤³¤Î¤è¤¦¤Ê¡¢''£²¤Ä°Ê¾å¤Î¾ðÊó¤ò£±¤Ä¤Î¾ðÊ󸻤Ȥ·¤Æ´ÉÍý¤¹¤ë¾ì¹ç¤ä¡¢true/false ¤Ç¤Ïǧ¼±¤·¤Ë¤¯¤¤¾ì¹ç¤Ë¤Ï¡¢
enum¤òºîÀ®¤·¡¢¤½¤Î¼ïÎà¤òÅÐÏ¿¤·¤Æ¤ª¤¯¤³¤È¤ò¤ª¤¹¤¹¤á¤·¤Þ¤¹''¡£
¡¡enum ¤ÇºîÀ®¤¹¤ë·¿¤Ë¤ÏǤ°Õ¤Î̾Á°¤òÉÕ¤±¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£¥¯¥é¥¹¤ÈƱ¤¸¤Ç¤¹¡£
Àë¸À¤·¤¿ enum Æâ¤Ë¤ÏǤ°Õ¤Î̾Á°¤ÎÎóµó»Ò¤òºîÀ®¤Ç¤¤Þ¤¹¡£¿ô¤Ë»ØÄê¤Ï¤Ê¤¯¡¢ÆüËܸì¤Ç¤âºîÀ®¤Ç¤¤Þ¤¹¡£
¡ãº£²ó¼ÂÁõ¤·¤¿ enum ¤ÇºîÀ®¤µ¤ì¤¿ PlayerAnimationState ·¿¤ÎÀë¸À¡ä
/// <summary> /// ¥×¥ì¥¤¥ä¡¼ÍѤΥ¥ã¥é¥¯¥¿¡¼¤Î¥¢¥Ë¥á¤Î¼ïÎà /// </summary> public enum PlayerAnimationState { Speed, Hit, Down, Clear, Idle, Jump, }
¡¡º£²ó¤Ï¡¢¥×¥ì¥¤¥ä¡¼¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Î¾õÂÖ¤òɽ¸½¤¹¤ëÊýË¡¤È¤·¤Æ enum ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿ PlayerAnimationState ·¿¤òÍÑ°Õ¤·¤Þ¤·¤¿¡£
Speed ¡Á Jump ¤Þ¤Ç¡¢6¼ïÎà¤ÎÎóµó»Ò¤òÀë¸À¤·¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï¼«Í³¤Ë̾Á°¤ÎÊѹ¹¡¢¿·¤·¤¤Îóµó»Ò¤ÎÄɲᦺï½ü¤¬¤Ç¤¤Þ¤¹¡£
¡¡ºîÀ®¤·¤¿ PlayerAnimationState ·¿¤Ï¾ðÊ󸻡¢¤Ä¤Þ¤ê¡¢ÀßÄê¾ðÊó¤Ç¤¢¤ê¡¢¤³¤Î¾ðÊó¤ò¼ÂºÝ¤Ë¥²¡¼¥àÆâ¤ÇÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢PlayerAnimationState ·¿¤ÎÊÑ¿ô¤ÎÀë¸À¤ò¹Ô¤¤¤Þ¤¹¡£
¡ãPlayerAnimationState ·¿¤ÎÊÑ¿ô¤ÎÀë¸À¡ä
¡¡public PlayerAnimationState currentPlayerAnimationState;
¡¡°Ê¾å¤Î¤è¤¦¤Ë enum ¤Ï¡¢enum ¤òÀë¸À¤·¤ÆÀßÄê¤ò¹Ô¤¦Éôʬ¤È¡¢¤½¤ì¤òÍøÍѤ¹¤ë¤¿¤á¤ÎÊÑ¿ô¤ÎÀë¸À¤Î£²¤Ä¤¬É¬Íפˤʤê¤Þ¤¹¡£
¼«ºî¤·¤¿ enum ¤Î PlayerAnimationState ·¿¤Ë¤Ï¡¢PlayerAnimationState ·¿Æâ¤ËÀë¸À¤·¤¿Îóµó»Ò¤ÎÃͤò£±¤Ä¤À¤±ÂåÆþ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
£²¤Ä°Ê¾å¤Î¾õÂÖ¤¬ÂåÆþ¤µ¤ì¤ë¤³¤È¤Ï¤¢¤êÆÀ¤Ê¤¤(¸ºß¤·¤Ê¤¤)¤¿¤á¡¢½èÍý¤òÇÓ¾Ū¤Ë¹½ÃÛ¤¹¤ëºÝ¤ËÌòΩ¤Á¤Þ¤¹¡£
¡ãÎóµó»Ò¤ÎÂåÆþ¡ä
// ¥¹¥Æ¡¼¥È´ÉÍý½èÍý¤òÄɲà currentPlayerAnimationState = PlayerAnimationState.Jump;
¡¡ÂåÆþ¤¹¤ë¾ì¹ç¤Ë¤Ïɬ¤º¡¢[enum ¤Î·¿Ì¾.Îóµó»Ò̾] ¤Ç»ØÄê¤ò¤·¤Þ¤¹¡£Îóµó»Ò̾¤Î¤ß¤Ç¤Î»ØÄê¤Ï½ÐÍè¤Þ¤»¤ó¡£
¡¡¤³¤Î¤è¤¦¤Ë£±¤Ä¤ÎÊÑ¿ôÆâ¤Ë¤Ï¡¢¤¤¤º¤ì¤«¤ÎÎóµó»Ò¤ÎÃͤ¬£±¤Ä¤À¤±ÂåÆþ¤Ç¤¤ë¤¿¤á¡¢
bool ·¿¤È¤Ï°Û¤Ê¤ê¡¢Àë¸À¤·¤¿Îóµó»Òʬ¤Îʬ´ô¤òÍÑ°Õ¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£
¤è¤Ã¤Æ¡¢true ¤Ê¤é/false ¤Ê¤é¡¢¤È¤¤¤¦Ê¬´ô¤Î·Á¤Ç¤Ï¤Ê¤¯¡¢¸½ºß¤Î PlayerAnimationState ¤ÎÃͤ¬ Jump ¤Ê¤é / Idle ¤Ê¤é / Clear ¤Ê¤é¡¢¤È¤¤¤¦É÷¤Ë¡¢
Îóµó»Ò¤ÎÃͤ˹ç¤ï¤»¤Æʬ´ô¤¬ºîÀ®¤Ç¤¤Þ¤¹¡£
¡¡enum ¤òÍøÍѤ¹¤ë¾ì¹ç¡¢¤½¤ÎÅÐÏ¿¤·¤Æ¤¢¤ëÎóµó»Ò¤«¤é¤·¤«¾ðÊó¤ò»ØÄê¤Ç¤¤Þ¤»¤ó¤Î¤Ç¡¢
Î㤨¤Ð¡¢Ê¸»úÎó¤È°Û¤Ê¤ê¡¢»ØÄê¤ËºÝ¤·¤ÆÂǤÁ´Ö°ã¤¨¤¬È¯À¸¤·¤Þ¤»¤ó¤Î¤Ç¡¢ÉÔÈ÷¤ÎÃͤ¬Æþ¤ë¤³¤È¤âËɤ°¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡°Ê¾å¤Î¤³¤È¤«¤é¡¢¥²¡¼¥à¤ÎÆâÍƤ˱þ¤¸¤¿ enum ¤ò¹Í¤¨¤ÆºîÀ®¤·¤Æ±¿ÍѤ·¤Þ¤¹¡£
¤Û¤«¤Ë¤Ï¡¢¥×¥ì¥¤¥ä¡¼¤Î¾õÂÖÍÑ(ÆÇ¡¢º®Íð¡¢áã¤ì¤È¤«)¡¢¥¢¥¤¥Æ¥à¤Î¼ïÎà(¾ÃÌ×ÉÊ¡¢Éð´ï¡¢Ëɶñ¡¢¤Ê¤É)¡¢
¥²¡¼¥à¤Î¾õÂÖ´ÉÍý(¥²¡¼¥à³«»ÏÁ°¡¢¥²¡¼¥àÃæ¡¢¥²¡¼¥à½ªÎ»¡Ë¤Ê¤É¡¢Èó¾ï¤Ë±þÍѤ¬Íø¤¯µ¡Ç½¤Ç¤¹¡£
¡¡¤Ê¤ª enum ¤Ç¤Ï³ÆÎóµó»Ò¤Ë¼«Æ°Åª¤ËÀ°¿ô¤ÎÈֹ椬Ϳ¤¨¤é¤ì¤Þ¤¹¡£°ìÈ־夫¤é 0 ¤ÇÏ¢È֤ˤʤäƤ¤¤Þ¤¹¡£
º£²ó¤Î¾ì¹ç¤Ç¤¢¤ì¤Ð¡¢Speed ¤Ë¤Ï 0¡¢Jump ¤Ë¤Ï 5 ¤Î¿ô»ú¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Þ¤¹¡£
¡¡¤³¤ÎÈÖ¹æ¤Ï¸«¤¨¤Ê¤¤¾ðÊó¤Ç¤¹¤¬¡¢Îóµó»Ò¤ò int ·¿¤Ë¥¥ã¥¹¥È¤ò¹Ô¤¦¤³¤È¤Ç¼èÆÀ¤·¤ÆÍøÍѽÐÍè¤Þ¤¹¡£
²¼µ¤ÎÎã¤Î¾ì¹ç¡¢enumValue ¤Ë¤Ï 1 ¤¬ÂåÆþ¤µ¤ì¤Þ¤¹¡£
¡ãenum ¤ÎÎóµó»Ò¤Î¥¥ã¥¹¥È¡ä
¡¡int eventValue = (int)PlayerAnimationState.Hit;
¡¡¤Þ¤¿¡¢Îóµó»Ò¤ÎÀë¸À»þ¤Ë¿ô»ú¤ò»ØÄꤷ¤ÆÂåÆþ¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£¤½¤Î¾ì¹ç¤Ë¤ÏÏ¢È֤ǤϤʤ¯¡¢»ØÄꤷ¤¿¿ôÃͤò¼èÆÀ½ÐÍè¤Þ¤¹¡£
¡ã¿ô»ú¤ÎÂåÆþ¤ÎÎã(º£²ó¤³¤ÎÊý¼°¤ÏÍøÍѤ·¤Þ¤»¤ó)¡ä
public enum PlayerAnimationState { Speed = 10, Hit = 100, Down = 5, Clear = 15, Idle = 30, Jump = 1000, }
¡¡¾åµ¤Î¤è¤¦¤ËÂåÆþ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢Îóµó»Ò¤ò int ·¿¤Ë¥¥ã¥¹¥È¤¹¤ë¤È¡¢ÂåÆþ¤·¤Æ¤¢¤ëÃͤ¬¼èÆÀ½ÐÍè¤Þ¤¹¡£
º£²ó¤Ï¿ô»ú¤ÎÂåÆþ¤Ï¹Ô¤Ã¤Æ¤¤¤Þ¤»¤ó¤Î¤Ç°ìÈÖ¾å¤ÎÎóµó»Ò¤Ë¤Ï 0 ¤«¤é½çÈ֤˺ÎÈÖ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¡¡enum ¤Ï¼«Ê¬¤ÎÌÜŪ¤Ë¹ç¤ï¤»¤Æ¼«Í³¤ËºîÀ®¤Ç¤¤Þ¤¹¡£
º£¸å¤âɬÍפ˱þ¤¸¤ÆºîÀ®¤·¡¢¥×¥í¥°¥é¥à¤òÆɤߤ䤹¤¯¡¢´ÉÍý¤ò¤·¤ä¤¹¤¤¥²¡¼¥à´Ä¶¤òºî¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£
¡¡Unity¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó¤Ï¡¢Animator¥¯¥é¥¹¤Ë¤è¤Ã¤ÆÍÍ¡¹¤Ê¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÀ©¸æ¤¬¹Ô¤¨¤Þ¤¹¡£
Unity¸ø¼°¥¹¥¯¥ê¥×¥È¥ê¥Õ¥¡¥ì¥ó¥¹
Animator
¡¡º£²ó¤Ï¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÁ«°Ü¤Î¤¿¤á¤Ë¡¢SetBool¥á¥½¥Ã¥É¡¢SetFloat¥á¥½¥Ã¥É¡¢SetTrigger¤òÍøÍѤ·¡¢Á«°Ü¤Î¾ò·ï¤ò¤³¤Î¥á¥½¥Ã¥É¤Î°ú¿ô¤Ë»ØÄꤷ¤Æ¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÁ«°Ü¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£
¡¡³Æ¥á¥½¥Ã¥É¤Î°ú¿ô¤Ë¤Ï¤½¤ì¤¾¤ì·¿¤Î»ØÄ꤬°Û¤Ê¤ê¤Þ¤¹¤¬¡¢¤¤¤º¤ì¤âÂè1°ú¿ô¤Ï string ·¿¤Ç¤¹¡£¤³¤ÎÉôʬ¤Ë¤Ï¡¢¥Ñ¥é¥á¡¼¥¿¤ÇÀßÄꤷ¤¿Ê¸»úÎó¤ò»ØÄꤷ¤Þ¤¹¡£
ʸ»úÎó¤Ç¤¹¤Î¤ÇÂçʸ»ú¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Þ¤¹¡£¥Ñ¥é¥á¡¼¥¿¤ËÅÐÏ¿¤·¤¿Ê¸»úÎó¤ò¤³¤ÎÂè1°ú¿ô¤Ë»ØÄꤹ¤ë¤³¤È¤Ç¥Ñ¥é¥á¡¼¥¿¤Î¤â¤Ä¾ðÊó¤òÊѹ¹¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¤½¤·¤Æ¡¢¥Ñ¥é¥á¡¼¥¿¤ÎÃͤòÊѹ¹¤¹¤ëÆâÍƤòÂè2°ú¿ô¤Ë»ØÄꤷ¤Þ¤¹¡£Î㤨¤Ð¡¢SetBool¤Ç¤¢¤ì¤Ð¡¢Âè1°ú¿ô¤Ë bool ·¿¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¤¢¤ë Idle ¤Îʸ»úÎó¤ò»ØÄꤷ¡¢Âè2°ú¿ô¤Ë true ¤ä false ¤ò»ØÄꤷ¤Þ¤¹¡£
// ÂÔµ¡¾õÂ֤Υ¢¥Ë¥á¤ÎºÆÀ¸¤ò»ß¤á¤Æ¡¢Áö¤ë¥¢¥Ë¥á¤ÎºÆÀ¸¤Ø¤ÎÁ«°Ü¤ò¹Ô¤¦ anim.SetBool("Idle", false); anim.SetFloat("Speed", 0.5f);
¡¡// Áö¤ë¥¢¥Ë¥á¤ÎºÆÀ¸¤ò»ß¤á¤Æ¡¢ÂÔµ¡¾õÂ֤Υ¢¥Ë¥á¤ÎºÆÀ¸¤Ø¤ÎÁ«°Ü¤ò¹Ô¤¦ anim.SetFloat("Speed", 0.0f); anim.SetBool("Idle", true);
¡¡¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤ÎÃͤò¥¹¥¯¥ê¥×¥È¤«¤é½ñ¤´¹¤¨¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£¤½¤Î·ë²Ì¤È¤·¤Æ¡¢¾ò·ï¤¬¹çÃפ·¤¿¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ËÁ«°Ü¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡º£²ó¤ÏÂè1°ú¿ô¤Ë¤Ä¤¤¤Æʸ»úÎó¤Ç¤ÎľÀܵ½Ò(¥ê¥Æ¥é¥ëɽµ)¤Ç¤Ï¤Ê¤¯¡¢
enum ¤Î PlayerAnimationState ·¿¤ò»ØÄꤷ¡¢¤½¤ì¤ò ToString ¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ string ·¿¤Ë¥¥ã¥¹¥È¤·¤Æ¤¤¤Þ¤¹¡£
¤³¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¡¢Ê¸»úÎó¤òľÀܽñ¤¹þ¤ó¤ÇÂǤÁ´Ö°ã¤¨¤ò¤·¤Æ¤·¤Þ¤¦¡¢¥¨¥é¡¼¤Î²ÄǽÀ¤òÇÓ½ü¤·¤Æ¤¤¤Þ¤¹¡£
¡ãº£²ó¤Î¼ÂÁõÎã¡ä
¡¡anim.SetFloat(PlayerAnimationState.Speed.ToString(), speed); ¡¡anim.SetBool(nextAnimState.ToString(), isChange); anim.SetTrigger(nextAnimState.ToString());
¡¡ÆäËÊ£¿ô¿Í¤Çºî¶È¤ò¤ª¤³¤Ê¤¦¾ì¹ç¤Ë¤Ï¶ËÎÏ¡¢Ê¸»úÎó¤òľÀܽñ¤¹þ¤à¤³¤È¤ÏÈò¤±¤¿Êý¤¬¤è¤¤¤Ç¤·¤ç¤¦¡£
¤Þ¤¿¥á¥½¥Ã¥É¤Î°ú¿ô¤òÍøÍѤ·¤¿¼ÂÁõ¤òÀ߷פ¹¤ë¤³¤È¤Ç¡¢ÊÑ¿ô¤ò¾å¼ê¤¯³èÍѤ·¤¿Àß·×(ÊÑ¿ô¤ÎÃͤˤè¤Ã¤Æ¼«Æ°Åª¤Ëʬ´ô²½¤µ¤»¤ë¤³¤È)¤¬½ÐÍè¤Þ¤¹¡£
¥Ñ¥é¥á¡¼¥¿¤ÈSet¡Á¥á¥½¥Ã¥É¤Î´ØÏ¢À
![](https://image01.seesaawiki.jp/i/o/i-school-memo/bAZzPol9So.png)
¥Ñ¥é¥á¡¼¥¿¤ÈSet¡Á¥á¥½¥Ã¥É¤Î´ØÏ¢À
![](https://image01.seesaawiki.jp/i/o/i-school-memo/nKGgGBQMSz.png)
¡ã¼Â¹ÔÆ°²è¡¡¥¹¥¯¥ê¥×¥È¤«¤é¥Ñ¥é¥á¡¼¥¿¤ÎÃͤòÊѹ¹¤·¡¢¾ò·ï¤òËþ¤¿¤·¤¿¥¢¥Ë¥á¡¼¥·¥ç¥ó¤òÁ«°Ü¤µ¤»¤ë¡ä
https://gyazo.com/faedc20577029997b12cf44479da64dd
¡ã»²¹Í¥µ¥¤¥È¡ä
Unity¸ø¼°¥¹¥¯¥ê¥×¥È¥ê¥Õ¥¡¥ì¥ó¥¹
SetFloat
Unity¸ø¼°¥¹¥¯¥ê¥×¥È¥ê¥Õ¥¡¥ì¥ó¥¹
SetBool
Unity¸ø¼°¥¹¥¯¥ê¥×¥È¥ê¥Õ¥¡¥ì¥ó¥¹
SetTrigger
¡¡¥Ò¥¨¥é¥ë¥¡¼¤Ë¤¢¤ë¥×¥ì¥¤¥ä¡¼ÍѤΥ²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë PlayerAnimation ¥¹¥¯¥ê¥×¥È¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥¿¥Ã¥Á¤·¤Þ¤¹¡£
¥¢¥¿¥Ã¥Á¤·¤¿ºÝ¤Ë¤Ïɬ¤º¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¡¢¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò¸«¤Æ¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Þ¤¹¡£
¡¡£±¤Ä¤Î¥¹¥¯¥ê¥×¥È¡¦¥Õ¥¡¥¤¥ë¤ÎÃæ¤ËÊ£¿ô¤Î¥¯¥é¥¹¤ò¹ç¤ï¤»¤ÆºîÀ®¤¹¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡£
¡¡º£²ó¤Ç¤¢¤ì¤Ð¡¢PlayerAnimation ¥¯¥é¥¹¤ÈƱ¤¸¥¹¥¯¥ê¥×¥È¤ÎÃæ¤Ë PlayerAnimationState ¤òºîÀ®¤¹¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡£
µ½Ò¤¹¤ë½çÈÖ¤ËÍ¥Îô¤Ï¤¢¤ê¤Þ¤»¤ó¡£
PlayerAnimation.cs
¡¡¥Õ¥¡¥¤¥ë¤Ï£±¤Ä¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¤³¤Î½ñ¤Êý¤Ç¤¢¤Ã¤Æ¤â¡¢Æ±¤¸µ¡Ç½¤¬ÍøÍѤǤ¤Þ¤¹¡£
¡¡Â¾¤Ë¤âÆþ¤ì»Ò¤Î¥¯¥é¥¹¤Ê¤É¡¢¥¹¥¯¥ê¥×¥È¤Ë¤Ï¿§¡¹¤Êµ½Ò¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£
³Ð¤¨¤Æ¤ª¤¯¤È¤¤¤¤¤Ç¤·¤ç¤¦¡£
¡¡Àè¤Û¤ÉºîÀ®¤·¤¿ PlayerAnimation ¥¯¥é¥¹¤òÍøÍѤ¹¤ë¤¿¤á¡¢¤¹¤Ç¤ËºîÀ®¤·¤Æ¤¢¤ë PlayerNavigationController ¥¯¥é¥¹¤Î½¤Àµ¤ò¹Ô¤¤¤Þ¤¹¡£
¤³¤Îµ¡Ç½¤òÄɲ乤뤳¤È¤Ç¡¢¥¥ã¥é¤Î¾õÂ֤ȥ¢¥Ë¥á¡¼¥·¥ç¥ó¤È¤òƱ´ü¤µ¤»¤Æ¡¢¥²¡¼¥àÆâ¤Ç¤ÎÀ°¹çÀ¤ò¼è¤ì¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤¤Þ¤¹¡£
Î㤨¤Ð¡¢°ÜÆ°¤·¤Æ¤¤¤ëºÝ¤Ë¤Ï°ÜÆ°ÍѤΥ¢¥Ë¥á¡¼¥·¥ç¥ó¤òºÆÀ¸¤µ¤»¡¢Ää»ß¤·¤Æ¤¤¤ë¤È¤¤Ë¤ÏÄä»ßÍѤΥ¢¥Ë¥á¡¼¥·¥ç¥ó¤ò¥ë¡¼¥×ºÆÀ¸¤µ¤»¤ë¡¢¤È¤¤¤¦¶ñ¹ç¤Ç¤¹¡£
¡¡´Ø¿ô¡Ê¥á¥½¥Ã¥É¡Ë¤ä¥¯¥é¥¹¤òºîÀ®¤·½ª¤ï¤ê¤Þ¤·¤¿¤é¡¢É¬¤º¤½¤Î´Ø¿ô¤ä¥¯¥é¥¹¤ÎÀâÌÀ¤ò½ñ¤¯¤è¤¦¤Ë¿´¤¬¤±¤Þ¤·¤ç¤¦¡£½ñ¤¯¾ì½ê¤Ï´Ø¿ô̾¡¢¤¢¤ë¤¤¤Ï¥¯¥é¥¹Ì¾¤Î£±¹Ô¾å¤ÎÉôʬ¤Ç¤¹¡£
Ⱦ³Ñ¥¹¥é¥Ã¥·¥å¤ò3¸ÄϢ³¤Çµ½Ò¤¹¤ë¤ÈÀâÌÀÍѤΥ³¥á¥ó¥È¤Ç¤¢¤ë¥µ¥Þ¥ê¡¼(³µÍ×)¤¬¼«Æ°Åª¤Ëµ½Ò¤µ¤ì¤Þ¤¹¡£
¡¡Ê̤ε»ö¤Ç¾Ü¤·¤¯²òÀ⤷¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤½¤Á¤é¤ò³Îǧ¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
¡¡=>¡¡ÃΤäƤª¤¤¿¤¤Æ¦Ãμ±
¡¡¥Ç¥Ð¥Ã¥°¤ÎÍÑ°Õ¤ò¹Ô¤¤¡¢¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤·¤Þ¤¹¡£
¡¡¤É¤Î¤è¤¦¤Ê¾õÂ֤ˤʤäƤ¤¤ì¤Ð¤è¤¤¤Î¤«¡¢Àµ¤·¤¤µóÆ°¤òÍý²ò¤·¤¿¾å¤Ç¥Ç¥Ð¥Ã¥°¤ò¹Ô¤¦¤è¤¦¤Ë¿´¤¬¤±¤Þ¤¹¡£
º£²ó¤Î¾ì¹ç¤Ç¤¢¤ì¤Ð¡¢¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ÎÁ«°Ü¤Î³Îǧ¤ò¹Ô¤¤¤¿¤¤¤Î¤Ç¡¢Game ¥Ó¥å¡¼¤Ç¤Î³Îǧ¤À¤±¤Ç¤Ï¤Ê¤¯
Animator ¥Ó¥å¡¼¤â°ì½ï¤Ë¸«¤ì¤ë¤è¤¦¤Ë¤·¤Æ¡¢¥¹¥Æ¡¼¥È¤Ø¤Î¥È¥é¥ó¥¸¥·¥ç¥ó(PlayerAnimation ¥¯¥é¥¹¤Ë¤è¤ë Animator ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ÎÀ©¸æ)¤â³Îǧ¤·¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡¡¡Game ¥Ó¥å¡¼¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡ã¼ÂÁõÆ°²è¢¡¡Animator ¥Ó¥å¡¼¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£
¡¡=>¡¡¼¡¤Ï¡¡¼ê½ç£±£°¡¡¡Ý¥«¥á¥é¤ÎÄɽ¾µ¡Ç½¡Ý¡¡¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯