(client)feat:视野范围检测,

This commit is contained in:
m0_75251201
2025-08-25 18:24:12 +08:00
parent 797cf69f75
commit d8a3daaca8
28 changed files with 1340 additions and 519 deletions

View File

@ -1,12 +1,41 @@
using Data;
using UnityEngine;
namespace Item
{
public class ItemResource
{
public string name;
public string description;
public Sprite icon;
public string DefName { get; protected set; } // 新增:物品的定义名称,唯一标识符
public string Name { get; protected set; } // 物品的显示名称 (来自 label)
public string Description { get; protected set; }
public Sprite Icon { get; protected set; }
public ItemRarity Rarity { get; protected set; }
public int MaxStack { get; protected set; }
public bool IsEquippable { get; protected set; }
// 构造函数,现在接受 defName
public ItemResource(string defName, string name, string description, Sprite icon, ItemRarity rarity, int maxStack, bool isEquippable)
{
DefName = defName; // 赋值 defName
Name = name;
Description = description;
Icon = icon;
Rarity = rarity;
MaxStack = maxStack;
IsEquippable = isEquippable;
}
}
public class WeaponResource : ItemResource
{
public AttributesDef Attributes { get; private set; }
// 构造函数,调用基类构造函数并传递 defName
public WeaponResource(string defName, string name, string description, Sprite icon, ItemRarity rarity, int maxStack, bool isEquippable, AttributesDef attributes)
: base(defName, name, description, icon, rarity, maxStack, isEquippable)
{
Attributes = attributes;
}
}
}