2026-04-11 에러수정
This commit is contained in:
@@ -21,9 +21,7 @@ public class Item : UseableEntry
|
||||
public ItemEffectType ItemEffectType;
|
||||
public GameObject ItemEffectVisual;
|
||||
public int SortId;
|
||||
public string ItemName;
|
||||
public Sprite Icon; //인벤토리용 2D 아이콘
|
||||
[TextArea] public string Description;
|
||||
|
||||
public bool IsStackable; // 중첩 가능 여부
|
||||
public int MaxStack = 99; //장비는 1개
|
||||
public int Rarity = 1; //기본등급 1
|
||||
@@ -46,4 +44,8 @@ public class Item : UseableEntry
|
||||
public float IntervalDamage;
|
||||
public float IntervalDamageTime;
|
||||
|
||||
public override void Use()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public void PickUp()
|
||||
private void PlayPickupEffect()
|
||||
{
|
||||
// 이펙트 프리팹을 소환하거나 소리를 재생
|
||||
Debug.Log($"{ItemInstance.Data.ItemName} 획득 이펙트 재생!");
|
||||
Debug.Log($"{ItemInstance.Data.EntryName} 획득 이펙트 재생!");
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
|
||||
@@ -352,14 +352,14 @@ public void SpawnItemToWorld(ItemInstance dropItem)
|
||||
Vector3 dropPosition = player != null ? player.transform.position + player.transform.forward * 1.5f + Vector3.up * (dropItem.Data.WorldScale.y * 0.5f + 0.25f) : Vector3.zero;
|
||||
|
||||
// 빈 게임오브젝트를 생성하고 WorldItem 컴포넌트를 붙임
|
||||
GameObject dropObj = new GameObject($"{dropItem.Data.ItemName}_Dropped");
|
||||
GameObject dropObj = new GameObject($"{dropItem.Data.EntryName}_Dropped");
|
||||
dropObj.transform.SetParent(GameManager.Instance.DynamicObjectsField.transform);
|
||||
dropObj.transform.position = dropPosition;
|
||||
|
||||
WorldItem worldItem = dropObj.AddComponent<WorldItem>();
|
||||
worldItem.SetItem(dropItem); // SetItem으로 데이터 주입 및 모델 생성
|
||||
|
||||
Debug.Log($"{dropItem.Data.ItemName} {dropItem.CurrentStack}개를 필드에 버렸습니다.");
|
||||
Debug.Log($"{dropItem.Data.EntryName} {dropItem.CurrentStack}개를 필드에 버렸습니다.");
|
||||
}
|
||||
|
||||
public void DropItemFromSlot(int slotIndex)
|
||||
|
||||
@@ -38,13 +38,8 @@
|
||||
*/
|
||||
|
||||
[CreateAssetMenu(menuName = "Skill/SkillData")]
|
||||
public class SkillData : ScriptableObject
|
||||
public class SkillData : UseableEntry
|
||||
{
|
||||
[Header("기본 정보")]
|
||||
public string SkillName;
|
||||
[TextArea] public string Description;
|
||||
public Sprite Icon;
|
||||
|
||||
[Header("스킬 분류")]
|
||||
public SkillType SkillType;
|
||||
public ActivationType ActivationType;
|
||||
@@ -75,6 +70,11 @@ public SkillLevelData GetLevelData(int level)
|
||||
int idx = Mathf.Clamp(level - 1, 0, Levels.Length - 1);
|
||||
return Levels[idx];
|
||||
}
|
||||
|
||||
public override void Use()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
|
||||
@@ -9,7 +9,7 @@ public void Execute(SkillInstance skill, Transform caster, float chargeRatio)
|
||||
// PlayerStat에 버프 적용
|
||||
// caster.GetComponent<PlayerStat>()?.ApplyBuff(levelData);
|
||||
|
||||
Debug.Log($"버프 적용: {skill.Data.SkillName}, 지속시간 {levelData.Duration}초");
|
||||
Debug.Log($"버프 적용: {skill.Data.EntryName}, 지속시간 {levelData.Duration}초");
|
||||
}
|
||||
|
||||
public void ExecuteAtPosition(SkillInstance skill, Transform caster, Vector3 targetPos, float chargeRatio)
|
||||
|
||||
@@ -26,8 +26,8 @@ private void Update()
|
||||
public void ShowTooltip(ItemInstance item, RectTransform slotRect)
|
||||
{
|
||||
_icon.sprite = item.Data.Icon;
|
||||
_titleText.text = item.Data.ItemName;
|
||||
_descriptionText.text = item.Data.Description;
|
||||
_titleText.text = item.Data.EntryName;
|
||||
_descriptionText.text = item.Data.EntryDesc;
|
||||
|
||||
//무기일 경우
|
||||
if (item.Data.ItemType == ItemType.EQUIPMENT)
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public abstract class UseableEntry : ScriptableObject
|
||||
{
|
||||
[Header("기본 정보")]
|
||||
public string EntryName;
|
||||
public string EntryDesc;
|
||||
public Sprite icon;
|
||||
[TextArea] public string EntryDesc;
|
||||
public Sprite Icon;
|
||||
|
||||
public abstract void Use();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user