ヒットエフェクト表示位置調整
This commit is contained in:
		
							parent
							
								
									7b96a2babb
								
							
						
					
					
						commit
						ce697df51c
					
				
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							|  | @ -0,0 +1,7 @@ | |||
| fileFormatVersion: 2 | ||||
| guid: 1bc5e14a40e0b4e94a1ba39081ac8436 | ||||
| PrefabImporter: | ||||
|   externalObjects: {} | ||||
|   userData:  | ||||
|   assetBundleName:  | ||||
|   assetBundleVariant:  | ||||
|  | @ -291,7 +291,7 @@ namespace MyGame.Scenes.MiniGame.Scripts | |||
|                 } | ||||
|                 if (item.ItemType == StageItem.Type.Obstacle) | ||||
|                 { | ||||
|                     player.Hit(); | ||||
|                     player.Hit(x.ClosestPoint(playerTransform.position)); | ||||
|                     x.enabled = false; | ||||
|                 } | ||||
|             }).AddTo(this); | ||||
|  |  | |||
|  | @ -18,6 +18,7 @@ namespace MyGame.Scenes.MiniGame.Scripts | |||
|         [SerializeField] private GameObject level1; | ||||
|         [SerializeField] private GameObject level2; | ||||
|         [SerializeField] private GameObject level3; | ||||
|         [SerializeField] private GameObject hitEffectPrefab; | ||||
|         private Animator animator; | ||||
|         private bool isJump; | ||||
|         private bool isResult; | ||||
|  | @ -87,12 +88,14 @@ namespace MyGame.Scenes.MiniGame.Scripts | |||
|         } | ||||
| 
 | ||||
|         // こける | ||||
|         public void Hit() | ||||
|         public void Hit(Vector3 hitPos) | ||||
|         { | ||||
|             if (isHit) | ||||
|             { | ||||
|                 return; | ||||
|             } | ||||
| 
 | ||||
|             Instantiate(hitEffectPrefab, hitPos, Quaternion.identity, transform.parent); | ||||
|             SoundManager.Instance.PlaySE("se_minigame_Collide"); | ||||
|             animator?.Play("Brother_pink_FallDown"); | ||||
|             isHit = true; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue