ãUnity7ããã¬ã¤ã¤ã¼ã®Animator Controllerãè¨å®ãããï¼ããã¼ã°ã©ã¤ã¯8ã
Unity5.0.0f4 Personal(2015å¹´6æ)
ååã®ç¶ãã§ãã
Â
ä»åã¯ãã¬ã¤ã¤ã¼ãã£ã©ã«ã¢ãã¡ã¼ã·ã§ã³ãåãä»ãã¦ããã¾ãã
Â
 ãç®æ¨ããã¬ã¤ã¤ã¼ã«ã¢ãã¡ã¼ã·ã§ã³ãè¨å®ãã
Â
2D Roguelike 8 of 14 : Player Animator Controller ...
Â
â ã¢ãã¡ã¼ã·ã§ã³ã®è¨å®
ã¾ãã¯Playerãã¬ãã¡ããHierarchyãã¥ã¼ã«æ»ãã¾ãã
Â
Â
次ã«Projectãã©ã«ãã®Animations>Animation Controllers>Playerãé¸æãPlayerã®Animatorãã¥ã¼ã表示ããã¦ä¸ããã
ç»åã®ããã«ã¢ãã¡ã¼ã·ã§ã³ãé ç½®ãã¦ããã¨åãããããã¨æãã¾ãã
Â
Playerã®Animatorãã¥ã¼
Â
次ã«Animatorãåãæ¿ãããã©ã¡ã¼ã¿ã¼ãè¨å®ãã¦ããã¾ããAnimatorãã¥ã¼å·¦å´ã«ããParameterãã¯ãªãã¯ããã©ã¡ã¼ã¿ã¼è¨å®ç»é¢ãåºããæ´ã«ãã©ã¹ãã¿ã³ãæ¼ããã©ã¡ã¼ã¿ã¼ã®ç¨®é¡ã決ãã¾ããä»åã¯Triggeråãé¸æãã¾ãã
Â
Triggeråãé¸æ
Â
ååã¯PlayerChopã«ãã¦ä¸ãããã¾ããåãè¦é ã§Triggeråã®PlayerHitãä½æãã¦ä¸ããã
Â
Triggeråã®å¤æ°PlayerChopã¨PlayerHitãä½æ
Â
æ°å¤ã表ãIntåãæ£èª¤å¤å®ãããBoolåã¯ããè¦ããã¾ãããTriggeråã¨ã¯ã©ããªãã®ãªã®ã§ãããï¼
Triggeråã¯ã»ã¨ãã©Boolåã¨åãã§ããã1ãã¬ã¼ã trueãå®è¡ãããå³åº§ã«falseã¸èªåçã«æ»ãç¹ã ããBoolåã¨ç°ãªãã¾ãã
ä»åã®ããã«ä¸åº¦ã ãã¢ã¯ã·ã§ã³ãããããã«Idleç¶æ ã¸æ»ãæãªã©ã«ä¾¿å©ã§ãã
Â
ããã§ã¯å®éã«ã¢ãã¡ã¼ã·ã§ã³é·ç§»ãè¨å®ãã¦ããã¾ããããPlayer Idleãå³ã¯ãªãã¯ããMake Transitionãé¸æããPlayer Chopã¸ç¢å°ãç¹ãã¦ä¸ããã
Â
Make Transitioné¸æ
Â
PlayerChopã«ç¢å°ãåãã
Â
ç¶ãã¦PlayerChopããPlayerIdleã¸ãMake Transitionã使ãç¢å°ãåãã¦ä¸ããã
Â
Make Transitioné¸æ
Â
ãäºããç¹ã
Â
PlayerIdleããPlayerChopã¸åããç¢å°ãã¯ãªãã¯ããInspectorãã¥ã¼ãè¦ã¦ä¸ããã
Â
ã¾ãã¯Has Exit Timeã®ãã§ãã¯ãå¤ãã¦ä¸ãããPlayer Idleç¶æ ã¯ã¢ãã¡ã¼ã·ã§ã³ãç¹°ãè¿ãè¡ãç¶ãããããã¢ãã¡ã¼ã·ã§ã³çµäºã®æ¡ä»¶ãæå®ããå¿ è¦ããªãããã§ãã
Â
ç¶ãã¦Transition Durationã0ã«ãã¦ä¸ããã
3Dã¢ãã¡ã¼ã·ã§ã³ã®å ´åãã¢ãã¡ã¼ã·ã§ã³ã¨ã¢ãã¡ã¼ã·ã§ã³ã®éã«ã¡ãã£ã¨ããæéãç¨æãããã¨ã§èªç¶ãªã¢ãã¡ã¼ã·ã§ã³ã¨ãªãã¾ãããã®ã¡ãã£ã¨ããæéãTransition Durationã§ãã
ãããSpriteç»åã使ã£ã2Dã¢ãã¡ã¼ã·ã§ã³ã®å ´åã¯å³åº§ã«åãæ¿ãã£ãã»ããèªç¶ã§ãããããåºæ¬çã«Transition Durationã¯0ã«ãã¦ãã¾ãã¾ãã
Â
Has Exit TimeãfalseãTransition Durationã0ã«è¨å®
Â
æå¾ã«ä¸çªä¸ã«ããConditionsã®ãã©ã¹ãã¿ã³ãæ¼ããã¢ãã¡ã¼ã·ã§ã³é·ç§»æ¡ä»¶ãæå®ãã¾ããä»åã¯PlayerIdleããPlayerChopã¸é·ç§»ããã®ã§ãTriggeråã®PlayerChopãé¸æãã¾ãã(PlayerChopãtrueã«ãªã£ãæã¢ãã¡ã¼ã·ã§ã³é·ç§»)
Â
Â
ç¶ãã¦PlayerChopããPlayerIdleã¸ä¼¸ã³ã¦ããç¢å°ãã¯ãªãã¯ããInspectorã®è¨å®ããã¦ããã¾ãã
Â
ä»åã¯1åã¢ãã¡ã¼ã·ã§ã³ãããPlayerIdleã¸æ»ãããã®ã§ãHas Exit TimeãtrueãExit Timeã1ã«è¨å®ãã¾ããTransition Durationã¯åãã0ã§ãã
ã¾ããTriggeråã¯èªåçã«falseã«æ»ããããConditionsã®è¨å®ã¯å¿ è¦ããã¾ããã
Â
PlayerChopâPlayerIdleã®è¨å®
Â
ããã§ã¯ã¢ãã¡ã¼ã·ã§ã³é·ç§»ããã¾ããã£ã¦ããã確èªããããã1åã²ã¼ã ãåããã¦ã¿ã¾ãããã
Â
ã²ã¼ã å®è¡æã«PlayerChopãã¯ãªãã¯ããã¨
Â
PlayerChopã¸ã¢ãã¡ã¼ã·ã§ã³é·ç§»ã
Â
PlayerChopãï¼åçµããã¨PlayerIdleã¢ãã¡ã¼ã·ã§ã³ã¸æ»ã
Â
ãã¾ãããã¾ããã§ããããã
Â
ç¶ãã¦å ¨ãåããããªãã¨ãPlayerHitã§ãè¡ãã¾ãã
Â
Make Transitionã§ç¸äºã«ã¢ãã¡ã¼ã·ã§ã³é·ç§»ã®ç¢å°ãå¼ã
Â
PlayerIdleâPlayerHitã®Inspectorè¨å®
Â
PlayerHitâPlayerIdleã®Inspectorè¨å®
Â
ããã§ã¯ãã¡ãããã¹ããã¦ã¿ã¾ãããã
Â
ã²ã¼ã å®è¡æã«PlayerHitãã¯ãªãã¯ããã¨
Â
PlayerHitã¢ãã¡ã¼ã·ã§ã³ã¸é·ç§»ã
Â
PlayerHitã1åçµããã¨PlayerIdleã¸æ»ã
Â
ä»åã¯ããã¾ã§ã§ãã
ãããã¨ããããã¾ããã
Â
ãUnityéçº7ãã¢ãã¡ã¼ã·ã§ã³ãä½ãããï¼ã2Dãã¼ã°ã©ã¤ã¯2ã
ãUnityéçº7ãFloorãã¢ã¤ãã ãä½æãããï¼ã2Dãã¼ã°ã©ã¤ã¯3ã
ãUnityéçº7ãBoardManagerãå¼ã³åºãGameManagerãä½æããã2Dãã¼ã°ã©ã¤ã¯5ã
ãUnityéçº7ãç ´å£å¯è½ãªå£(Wall)ãä½æãããï¼ããã¼ã°ã©ã¤ã¯7ã
ãUnityéçº7ããã¬ã¤ã¤ã¼ã®ã¢ãã¡ã¼ã¿ã¼ãè¨å®ãããï¼ããã¼ã°ã©ã¤ã¯8ã
ãUnityéçº7ããã¬ã¤ã¤ã¼ç¨ã®ã¹ã¯ãªãããè¨å®ãããï¼ããã¼ã°ã©ã¤ã¯9ã
ãUnityéçº7ãBGMã¨å¹æé³ãä»ããã2Dãã¼ã°ã©ã¤ã¯13ã
ãUnityéçº7ãã¿ããããã«ã«å¯¾å¿ããããï¼ã2Dãã¼ã°ã©ã¤ã¯14(Fin)ã
Â