convert game playing..

This commit is contained in:
2026-09-23 12:53:52 +09:00
parent 37c7942b71
commit 5d11288a6f
136 changed files with 15856 additions and 299 deletions
+53 -3
View File
@@ -22,6 +22,7 @@ namespace BumpCombat.Enemies
private bool lancerTipNeedsRebase;
private bool necrofireRayActive;
private bool necrofireRayHitConfirmed;
private float necrofireRayLength;
private bool meleeAttackActive;
private bool meleeHitConfirmed;
private StageEnemyEffectVisual necrofireRayVisual;
@@ -392,12 +393,16 @@ namespace BumpCombat.Enemies
Vector2 direction = lockedDirection.sqrMagnitude > 0.0001f
? lockedDirection
: Vector2.right;
float length = controller.AttackLength;
necrofireRayLength = GetTerrainBlockedLength(
attackOrigin,
direction,
controller.AttackLength,
controller.AttackWidth * 0.5f);
necrofireRayVisual = StageEnemyEffectVisual.PlayRay(
gameObject,
attackOrigin,
direction,
length,
necrofireRayLength,
controller.AttackWidth,
controller.ActiveDuration);
TickNecrofireRay();
@@ -982,7 +987,13 @@ namespace BumpCombat.Enemies
Vector2 direction = lockedDirection.sqrMagnitude > 0.0001f
? lockedDirection
: Vector2.right;
float length = controller.AttackLength;
float length = necrofireRayLength > 0f
? necrofireRayLength
: GetTerrainBlockedLength(
attackOrigin,
direction,
controller.AttackLength,
controller.AttackWidth * 0.5f);
float width = Mathf.Max(0.001f, controller.AttackWidth);
Vector2 center = attackOrigin + direction * (length * 0.5f);
float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
@@ -1018,5 +1029,44 @@ namespace BumpCombat.Enemies
}
}
}
private static float GetTerrainBlockedLength(
Vector2 origin,
Vector2 direction,
float maxLength,
float radius)
{
float clampedLength = Mathf.Max(0f, maxLength);
if (clampedLength <= 0f || direction.sqrMagnitude <= 0.0001f)
{
return clampedLength;
}
RaycastHit2D[] hits = Physics2D.CircleCastAll(
origin,
Mathf.Max(0.01f, radius),
direction.normalized,
clampedLength,
Physics2D.AllLayers);
float blockedLength = clampedLength;
for (int i = 0; i < hits.Length; i++)
{
Collider2D collider = hits[i].collider;
if (collider == null || collider.isTrigger)
{
continue;
}
bool isTerrain = collider.GetComponentInParent<BumpCombat.Stage.StageObstacle>() != null
|| collider.name.StartsWith("Wall_")
|| collider.gameObject.name.Contains("Wall");
if (isTerrain)
{
blockedLength = Mathf.Min(blockedLength, hits[i].distance);
}
}
return blockedLength;
}
}
}