feat(BT12-Dev): MonsterRandomizer 수동 idle animation (6×4 frames) + Projectile speed 12→6 (거리 차이 체감)
This commit is contained in:
parent
dd6ab3f8f1
commit
1ef19890a5
|
|
@ -361,10 +361,29 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: f74e42a58e48af646a73723847df5633, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::Platformer.Mechanics.MonsterRandomizer
|
||||
idleSprites:
|
||||
idleFrames:
|
||||
- {fileID: -7548370174848201806, guid: f7b7e5d5d35e8ea4a9574fc970089486, type: 3}
|
||||
- {fileID: 3965259580443734907, guid: eb4754ac8816180459f43ea0d2be515d, type: 3}
|
||||
- {fileID: 3875302334163674375, guid: f8a4b8c30ad9dc0479c2a21f635975c0, type: 3}
|
||||
- {fileID: -5286858119833128327, guid: f8519f10c50debc448559483e0af1b42, type: 3}
|
||||
- {fileID: 4852648563935847630, guid: f8f1bd54f70dc914f9ff6999cff72846, type: 3}
|
||||
- {fileID: -2075586642352475843, guid: 9dd5ae40315dfde4aa078c1bac029536, type: 3}
|
||||
- {fileID: -4443778377869457348, guid: 0c9ad66301856634a91cf0e197d82f1f, type: 3}
|
||||
- {fileID: -1033834695554640417, guid: 5ee9ab2bd24109d4998b005dbb896611, type: 3}
|
||||
- {fileID: -480068022978346209, guid: 2cd59e341ddcef747b2fdeed0e184687, type: 3}
|
||||
- {fileID: 6320002499032068693, guid: ca8ffcfca8e7451449d5dd9222a808df, type: 3}
|
||||
- {fileID: 5702032684225411157, guid: 22e51794b9b3d194e93aaf103aab3212, type: 3}
|
||||
- {fileID: -6575996007543532477, guid: 0f2b5a062cd5d154d87bd0b576102c53, type: 3}
|
||||
- {fileID: 1142325901465378314, guid: 601020362ae2a214298ee67b288426c6, type: 3}
|
||||
- {fileID: -2383216395390897268, guid: f815cc0415b5fe94f951ff5814c7366c, type: 3}
|
||||
- {fileID: 823019882062329887, guid: 39ea050ebee544740bfe48b5bf3ec6fe, type: 3}
|
||||
- {fileID: 3458522810709938060, guid: 20dfa65d954a4434a8cda4938dd43da9, type: 3}
|
||||
- {fileID: 3001420397446177360, guid: f2ccd91debeaa624bb282fbaa4d0153b, type: 3}
|
||||
- {fileID: -889286983698815187, guid: 5705c3e56b737094592a94a7727b8f07, type: 3}
|
||||
- {fileID: -1578793236100974128, guid: fff66ff621553424b9943adbc310a2c4, type: 3}
|
||||
- {fileID: 1103436243820016618, guid: 61969d12f2371b041b41c21d437bb4a9, type: 3}
|
||||
- {fileID: 5433026174052882790, guid: 115d57f5258ccb74f86354a2cd28045d, type: 3}
|
||||
- {fileID: 8917375057226933945, guid: 5445e614d5225714e9550e08f8bccec1, type: 3}
|
||||
- {fileID: -4095915237629478068, guid: 1f8ec15a958211a478994dd27d1c879b, type: 3}
|
||||
- {fileID: 2697896165774990149, guid: 611097d2df9e43b40bec486f141c7ae9, type: 3}
|
||||
frameInterval: 0.15
|
||||
|
|
|
|||
|
|
@ -3,31 +3,55 @@ using UnityEngine;
|
|||
namespace Platformer.Mechanics
|
||||
{
|
||||
/// <summary>
|
||||
/// 몬스터 종류 랜덤 영역. Awake 영역 6 종 (M001~M006) 영역 영역 idle sprite 영역 random 적용.
|
||||
/// PD 지시 (2026-05-10): "몬스터 종류 다양하게 반영".
|
||||
/// Animator 영역 영역 — sprite 자동 영역 영역 영역 영역 — Animator 영역 영역 (death animation 영역 영역 영역 영역 후속 영역).
|
||||
/// 몬스터 종류 랜덤 영역 + 수동 idle animation.
|
||||
/// PD 지시 (2026-05-10): 6 종 (M001~M006) random + animation 영역.
|
||||
/// Animator 영역 영역 (sprite 자동 영역 영역 X) — 4 frame idle loop 수동 영역.
|
||||
/// </summary>
|
||||
public class MonsterRandomizer : MonoBehaviour
|
||||
{
|
||||
[Tooltip("M001~M006 idle sprite 영역 (Inspector 영역 영역 영역 영역·Awake 영역 1 영역 random 영역)")]
|
||||
public Sprite[] idleSprites;
|
||||
[Tooltip("6 종 × 4 frame idle sprite (24 sprite·6 group). Inspector 영역 영역 — 0~3=M001·4~7=M002·...")]
|
||||
public Sprite[] idleFrames;
|
||||
|
||||
[Tooltip("frame 영역 (초). 0.15s = 1 frame")]
|
||||
public float frameInterval = 0.15f;
|
||||
|
||||
const int FramesPerMonster = 4;
|
||||
int _monsterIdx;
|
||||
int _frame;
|
||||
float _elapsed;
|
||||
SpriteRenderer _sr;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (idleSprites == null || idleSprites.Length == 0)
|
||||
{
|
||||
idleSprites = Resources.LoadAll<Sprite>("Monsters");
|
||||
if (idleSprites == null || idleSprites.Length == 0) return;
|
||||
}
|
||||
|
||||
var sr = GetComponent<SpriteRenderer>();
|
||||
if (sr == null) return;
|
||||
|
||||
_sr = GetComponent<SpriteRenderer>();
|
||||
var anim = GetComponent<Animator>();
|
||||
if (anim != null) anim.enabled = false; // sprite 자동 영역 영역
|
||||
|
||||
var pick = idleSprites[Random.Range(0, idleSprites.Length)];
|
||||
if (pick != null) sr.sprite = pick;
|
||||
int monsters = (idleFrames != null) ? idleFrames.Length / FramesPerMonster : 0;
|
||||
if (monsters <= 0) return;
|
||||
_monsterIdx = Random.Range(0, monsters);
|
||||
_frame = 0;
|
||||
_elapsed = 0f;
|
||||
ApplyFrame();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (_sr == null || idleFrames == null) return;
|
||||
_elapsed += Time.deltaTime;
|
||||
if (_elapsed >= frameInterval)
|
||||
{
|
||||
_elapsed = 0f;
|
||||
_frame = (_frame + 1) % FramesPerMonster;
|
||||
ApplyFrame();
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyFrame()
|
||||
{
|
||||
int idx = _monsterIdx * FramesPerMonster + _frame;
|
||||
if (idx >= 0 && idx < idleFrames.Length && idleFrames[idx] != null)
|
||||
_sr.sprite = idleFrames[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ namespace EerieVillage.Skills.Effectors
|
|||
protected ActiveSkillRuntime _runtime;
|
||||
protected PlayerSkillInventory _inventory;
|
||||
protected Vector2 _direction;
|
||||
protected float _speed = 12f;
|
||||
protected float _lifetime = 3f;
|
||||
protected float _speed = 6f; // BT12-Dev 2026-05-10 PD — 거리 차이 체감 영역 영역 (12 → 6)
|
||||
protected float _lifetime = 5f; // 영역 영역 영역 (Long 18.67 / 6 = 3.11s 영역 영역)
|
||||
|
||||
// BT12-Dev 2026-05-10 (PD #1·#2) — 거리 제한·벽 충돌 영역
|
||||
protected Vector2 _spawnPosition;
|
||||
|
|
|
|||
Loading…
Reference in New Issue