调整部分数据表配置,优化 SpriteCache 功能

This commit is contained in:
2026-09-13 20:36:21 +08:00
parent de53890de6
commit 7dc529a840
520 changed files with 24231 additions and 967 deletions
@@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using SepCore.Entity;
using SepCore.Entity.Weapon;
using UnityEngine;
namespace SepCore.Components
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using SepCore.Definition;
using SepCore.Entity.Weapon;
using SepCore.Entity;
using UnityEngine;
@@ -8,11 +7,6 @@ namespace SepCore.Components
{
public class BackpackComponent : MonoBehaviour
{
/// <summary>
/// 武器槽容量,由 RoleConfig 决定。
/// </summary>
private int _weaponCapacity;
/// <summary>
/// 玩家类引用。
/// </summary>
@@ -40,14 +34,13 @@ namespace SepCore.Components
public IReadOnlyList<WeaponBase> Weapons => _weapons;
public IReadOnlyList<PropItem> Props => _props;
public int WeaponCapacity => _weaponCapacity;
public int WeaponCapacity => GameEntry.Luban.Global.WeaponCapacity;
public void OnInit(Player player, int weaponCapacity)
public void OnInit(Player player)
{
_weaponCapacity = weaponCapacity;
_player = player;
_weapons = new List<WeaponBase>(_weaponCapacity);
_weapons = new List<WeaponBase>(WeaponCapacity);
_props = new List<PropItem>();
_statComponent = GetComponent<StatComponent>();
}
@@ -60,7 +53,7 @@ namespace SepCore.Components
public bool AttachWeapon(WeaponBase weapon)
{
if (_weapons.Count == _weaponCapacity) return false;
if (_weapons.Count == WeaponCapacity) return false;
GameEntry.Entity.AttachEntity(weapon.Id, _player.Id, _weaponSlots[_weapons.Count]);
_weapons.Add(weapon);
weapon.SetEnabled(true);