From 8bd28fdbbd954fb52f5afdf2c66df425dfb3ac82 Mon Sep 17 00:00:00 2001 From: Ino Date: Tue, 13 Jan 2026 15:20:15 +0900 Subject: [PATCH] =?UTF-8?q?=ED=88=AC=EC=82=AC=EC=B2=B4=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EB=8D=B0=EC=9D=B4=ED=84=B0,=20=EB=AA=AC=EC=8A=A4?= =?UTF-8?q?=ED=84=B0=20=ED=88=AC=EC=82=AC=EC=B2=B4=20=EB=B0=9C=EC=82=AC=20?= =?UTF-8?q?=EB=93=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ResWork/Prefab/Play_Ingame.prefab | 1 + .../Script/InGame/Actor/AimArrowController.cs | 7 ++++- Assets/Script/InGame/Actor/MobActor.cs | 8 +++++- Assets/Script/InGame/IngameMgr.cs | 4 +-- Assets/Script/InGame/Projectile/Projectile.cs | 27 +++++++++++++++---- .../Script/InGame/Projectile/ProjectileMgr.cs | 9 +++---- 6 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Assets/ResWork/Prefab/Play_Ingame.prefab b/Assets/ResWork/Prefab/Play_Ingame.prefab index 04f7380..ff113aa 100644 --- a/Assets/ResWork/Prefab/Play_Ingame.prefab +++ b/Assets/ResWork/Prefab/Play_Ingame.prefab @@ -5128,6 +5128,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5d5c7d7015715f149a39eab8276626c3, type: 3} m_Name: m_EditorClassIdentifier: + go_child: {fileID: 0} texts_money: - {fileID: 351787397619305963} - {fileID: 351787398816937878} diff --git a/Assets/Script/InGame/Actor/AimArrowController.cs b/Assets/Script/InGame/Actor/AimArrowController.cs index fc9fd19..e621f31 100644 --- a/Assets/Script/InGame/Actor/AimArrowController.cs +++ b/Assets/Script/InGame/Actor/AimArrowController.cs @@ -34,7 +34,12 @@ public class AimArrowController : MonoBehaviour isAiming = false; var unit = IngameMgr.Ins.Get_CurUnitTData(); - ProjectileMgr.Ins.Get(unit.n_ProjectileID, arrow.transform).Set(unit.n_ProjectileID); + ProjectileMgr.Ins.Shoot_Projectile(new ProjectileData + { + IsPC = true, + m_Data = table_projectile.Ins.Get_Data(unit.n_ProjectileID), + tf_Start = arrow.transform + }); } void UpdateArrow(Vector2 currentPos) diff --git a/Assets/Script/InGame/Actor/MobActor.cs b/Assets/Script/InGame/Actor/MobActor.cs index 048a806..b335b67 100644 --- a/Assets/Script/InGame/Actor/MobActor.cs +++ b/Assets/Script/InGame/Actor/MobActor.cs @@ -77,6 +77,12 @@ public class MobActor : MonoBehaviour IEnumerator Co_AttackProjectile() { yield return new WaitForSeconds(1f); - ProjectileMgr.Ins.Get(m_Data.n_ProjectileID, transform).Set(m_Data.n_ProjectileID); + + ProjectileMgr.Ins.Shoot_Projectile(new ProjectileData + { + IsPC = false, + m_Data = table_projectile.Ins.Get_Data(m_Data.n_ProjectileID), + tf_Start = transform + }); } } \ No newline at end of file diff --git a/Assets/Script/InGame/IngameMgr.cs b/Assets/Script/InGame/IngameMgr.cs index aff7064..4897254 100644 --- a/Assets/Script/InGame/IngameMgr.cs +++ b/Assets/Script/InGame/IngameMgr.cs @@ -38,8 +38,8 @@ public class IngameMgr : MonoBehaviourSingletonTemplate { texts_money[0].text = m_Coin.ToString(); texts_money[1].text = m_Item.ToString(); - texts_money[2].text = $"Wave {m_Wave}/{CurStageData.n_MaxWave}"; - slider_wave.value = ((m_Wave - 1) / (float)CurStageData.n_MaxWave); + texts_money[2].text = $"Wave {(m_Wave > CurStageData.n_MaxWave ? CurStageData.n_MaxWave : m_Wave)}/{CurStageData.n_MaxWave}"; + slider_wave.value = (m_Wave - 1) / (float)CurStageData.n_MaxWave; t_hp.text = m_HP.ToString(); slider_exp.value = 0f; diff --git a/Assets/Script/InGame/Projectile/Projectile.cs b/Assets/Script/InGame/Projectile/Projectile.cs index 4565e33..1749afa 100644 --- a/Assets/Script/InGame/Projectile/Projectile.cs +++ b/Assets/Script/InGame/Projectile/Projectile.cs @@ -1,5 +1,7 @@ using CodeStage.AntiCheat.ObscuredTypes; using UnityEngine; +using static UnityEditor.PlayerSettings; +using static UnityEngine.Rendering.DebugUI.Table; public class Projectile : MonoBehaviour { @@ -10,7 +12,7 @@ public class Projectile : MonoBehaviour Vector2 prevPos; ObscuredInt m_bounceCount; - ProjectileTableData m_Data; + ProjectileData m_ProjectileData; #region 투사체 매니저 ProjectileMgr owner; @@ -28,15 +30,20 @@ public class Projectile : MonoBehaviour owner.Return(this); // 이펙트 표시 필요 } - public ProjectileTableData Get_ProjectileTData() { return m_Data; } + public ProjectileTableData Get_ProjectileTData() { return m_ProjectileData.m_Data; } #endregion - public void Set(int id) + public void Set(ProjectileData pd) { + m_ProjectileData = pd; + + transform.SetPositionAndRotation(m_ProjectileData.tf_Start.position, m_ProjectileData.tf_Start.rotation); + if (!m_ProjectileData.IsPC) + transform.eulerAngles = new Vector3(0f, 0f, 180f); + dir = transform.up.normalized; - m_Data = table_projectile.Ins.Get_Data(id); - m_bounceCount = m_Data.n_AttackBounceLimit; + m_bounceCount = m_ProjectileData.m_Data.n_AttackBounceLimit; m_bounceCount.RandomizeCryptoKey(); } @@ -50,6 +57,8 @@ public class Projectile : MonoBehaviour private void OnTriggerEnter2D(Collider2D collision) { + if (!m_ProjectileData.IsPC && collision.tag == "Mob") return; + if (m_bounceCount <= 0) { Kill(); @@ -122,4 +131,12 @@ public class Projectile : MonoBehaviour } } } +} + +public class ProjectileData +{ + public ProjectileTableData m_Data; + public Transform tf_Start; + ObscuredBool _IsPC; public bool IsPC { get { return _IsPC; } set { _IsPC = value; _IsPC.RandomizeCryptoKey(); } } + ObscuredInt _Lv; public int Lv { get { return _Lv; } set { _Lv = value; _Lv.RandomizeCryptoKey(); } } } \ No newline at end of file diff --git a/Assets/Script/InGame/Projectile/ProjectileMgr.cs b/Assets/Script/InGame/Projectile/ProjectileMgr.cs index 9adfa41..b34c9e0 100644 --- a/Assets/Script/InGame/Projectile/ProjectileMgr.cs +++ b/Assets/Script/InGame/Projectile/ProjectileMgr.cs @@ -33,13 +33,13 @@ public class ProjectileMgr : MonoBehaviourSingletonTemplate } } - public Projectile Get(int projectileid, Transform tf) + public void Shoot_Projectile(ProjectileData pd) { - var data = table_projectile.Ins.Get_Data(projectileid); - return Get(data.s_ProjectilePrefabs, tf.position, tf.rotation); + var proj = Get(pd.m_Data.s_ProjectilePrefabs); + proj.Set(pd); } - public Projectile Get(string prefabPath, Vector3 pos, Quaternion rot) + public Projectile Get(string prefabPath) { if (!pools.TryGetValue(prefabPath, out Queue pool)) { @@ -49,7 +49,6 @@ public class ProjectileMgr : MonoBehaviourSingletonTemplate Projectile p = pool.Count > 0 ? pool.Dequeue() : CreateExtra(prefabPath); p.gameObject.SetActive(true); - p.transform.SetPositionAndRotation(pos, rot); return p; }