fix(BT12-Dev Phase B): FX 재생 X — ParticleSystem 명시 Play + Collider 자식 분리 (PD 보고 2026-05-13)
원인 추정: - PoisonSwampInstance 영역 BoxCollider2D·Rigidbody2D 영역 FX root 직접 부착 → ParticleSystem 영역 영향 가능 - Instantiate playOnAwake 정합·그러나 명시 Play() 호출 안전망 영역 누락 fix: - PoisonSwampSpawner.Trigger — FX root 영역 GetComponentsInChildren<ParticleSystem>(true) 영역 명시 ps.Play(true) - PoisonSwampInstance — BoxCollider2D·Rigidbody2D 영역 자식 GO 분리 (PoisonSwamp_Collider)·FX root 영역 visualRoot 보관·duration 종료 시 함께 Destroy - PoisonedEnemyMarker.Tick — FX_Venom_Spray 영역 동일 ParticleSystem.Play(true) 명시 호출 - SpiritFireSpawner.Trigger — 동일 명시 Play(true) 호출 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f292eb4fb3
commit
b1b476a061
|
|
@ -50,6 +50,11 @@ namespace EerieVillage.Skills.Effectors
|
||||||
{
|
{
|
||||||
swampGo = Object.Instantiate(data.OnHitFxPrefab, spawnPos, Quaternion.identity);
|
swampGo = Object.Instantiate(data.OnHitFxPrefab, spawnPos, Quaternion.identity);
|
||||||
swampGo.transform.localScale *= data.HitFxScale;
|
swampGo.transform.localScale *= data.HitFxScale;
|
||||||
|
// PD 지시 2026-05-13 — ParticleSystem 명시 Play (playOnAwake 영역 정합·재발 안전망)
|
||||||
|
foreach (var ps in swampGo.GetComponentsInChildren<ParticleSystem>(true))
|
||||||
|
{
|
||||||
|
ps.Play(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -58,8 +63,14 @@ namespace EerieVillage.Skills.Effectors
|
||||||
}
|
}
|
||||||
swampGo.hideFlags = HideFlags.DontSave;
|
swampGo.hideFlags = HideFlags.DontSave;
|
||||||
|
|
||||||
var instance = swampGo.AddComponent<PoisonSwampInstance>();
|
// PD 지시 2026-05-13 — BoxCollider2D·Rigidbody2D 영역 자식 GO 분리 (ParticleSystem 영역 root 영향 차단)
|
||||||
instance.Init(data, Mathf.Max(data.BaseCooldown, 1f));
|
var colliderGo = new GameObject("PoisonSwamp_Collider");
|
||||||
|
colliderGo.hideFlags = HideFlags.DontSave;
|
||||||
|
colliderGo.transform.SetParent(swampGo.transform, false);
|
||||||
|
colliderGo.transform.localPosition = Vector3.zero;
|
||||||
|
|
||||||
|
var instance = colliderGo.AddComponent<PoisonSwampInstance>();
|
||||||
|
instance.Init(data, Mathf.Max(data.BaseCooldown, 1f), swampGo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,12 +83,14 @@ namespace EerieVillage.Skills.Effectors
|
||||||
float _spawnTime;
|
float _spawnTime;
|
||||||
float _duration;
|
float _duration;
|
||||||
BoxCollider2D _col;
|
BoxCollider2D _col;
|
||||||
|
GameObject _swampVisualRoot; // PD 지시 2026-05-13 — FX GO 영역 별도·duration 종료 시 함께 Destroy
|
||||||
|
|
||||||
public void Init(ActiveSkillData data, float duration)
|
public void Init(ActiveSkillData data, float duration, GameObject visualRoot)
|
||||||
{
|
{
|
||||||
_data = data;
|
_data = data;
|
||||||
_duration = duration;
|
_duration = duration;
|
||||||
_spawnTime = Time.unscaledTime;
|
_spawnTime = Time.unscaledTime;
|
||||||
|
_swampVisualRoot = visualRoot;
|
||||||
|
|
||||||
// 자식 BoxCollider2D 부착·HitboxSize 영역 정합
|
// 자식 BoxCollider2D 부착·HitboxSize 영역 정합
|
||||||
_col = gameObject.AddComponent<BoxCollider2D>();
|
_col = gameObject.AddComponent<BoxCollider2D>();
|
||||||
|
|
@ -99,7 +112,9 @@ namespace EerieVillage.Skills.Effectors
|
||||||
{
|
{
|
||||||
if (Time.unscaledTime - _spawnTime >= _duration)
|
if (Time.unscaledTime - _spawnTime >= _duration)
|
||||||
{
|
{
|
||||||
Destroy(gameObject);
|
// FX 영역 root 영역 함께 Destroy
|
||||||
|
if (_swampVisualRoot != null) Destroy(_swampVisualRoot);
|
||||||
|
else Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,6 +175,11 @@ namespace EerieVillage.Skills.Effectors
|
||||||
var fx = Object.Instantiate(_data.OnDotFxPrefab, transform.position, Quaternion.Euler(0f, 0f, _data.FxRotation), transform);
|
var fx = Object.Instantiate(_data.OnDotFxPrefab, transform.position, Quaternion.Euler(0f, 0f, _data.FxRotation), transform);
|
||||||
fx.hideFlags = HideFlags.DontSave;
|
fx.hideFlags = HideFlags.DontSave;
|
||||||
fx.transform.localScale *= _data.DotFxScale;
|
fx.transform.localScale *= _data.DotFxScale;
|
||||||
|
// PD 지시 2026-05-13 — ParticleSystem 명시 Play (playOnAwake 영역 정합·재발 안전망)
|
||||||
|
foreach (var ps in fx.GetComponentsInChildren<ParticleSystem>(true))
|
||||||
|
{
|
||||||
|
ps.Play(true);
|
||||||
|
}
|
||||||
FxAutoDestroyUnscaled.Attach(fx, 1.5f);
|
FxAutoDestroyUnscaled.Attach(fx, 1.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ namespace EerieVillage.Skills.Effectors
|
||||||
{
|
{
|
||||||
shieldGo = Object.Instantiate(data.OnHitFxPrefab, spawnPos, Quaternion.identity, inventory.transform);
|
shieldGo = Object.Instantiate(data.OnHitFxPrefab, spawnPos, Quaternion.identity, inventory.transform);
|
||||||
shieldGo.transform.localScale *= data.HitFxScale;
|
shieldGo.transform.localScale *= data.HitFxScale;
|
||||||
|
// PD 지시 2026-05-13 — ParticleSystem 명시 Play (playOnAwake 영역 정합·재발 안전망)
|
||||||
|
foreach (var ps in shieldGo.GetComponentsInChildren<ParticleSystem>(true))
|
||||||
|
{
|
||||||
|
ps.Play(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue