コード例 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (damageSource.IsCollisionNotIgnoredAndDamagable(collision))
     {
         float      rngX   = Random.Range(-effectPossibilityRadius, effectPossibilityRadius);
         float      rngY   = Random.Range(0f, effectPossibilityRadius);
         GameObject effect = Instantiate(hitParticleEffect, collision.transform);
         effect.transform.localPosition = new Vector3(rngX, rngY, 0f);
     }
 }