替换玩家模型素材,添加 ChildrenMap 配置挂点
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using SepCore.Battle;
|
||||
using SepCore.CustomUtility;
|
||||
using SepCore.Definition;
|
||||
using SepCore.Entity;
|
||||
using UnityEngine;
|
||||
@@ -49,7 +50,7 @@ namespace SepCore.Components
|
||||
|
||||
_weapons = new List<WeaponBase>(WeaponCapacity);
|
||||
_props = new List<PropItem>();
|
||||
_statComponent = GetComponent<StatComponent>();
|
||||
_statComponent = player.StatComponent;
|
||||
_synergyManager.Initialize();
|
||||
}
|
||||
|
||||
@@ -76,12 +77,64 @@ namespace SepCore.Components
|
||||
if (result)
|
||||
{
|
||||
GameEntry.Entity.DetachEntity(weapon.Id, _player.Id);
|
||||
RealignWeaponSlots();
|
||||
_synergyManager.RefreshSynergies(_weapons, _statComponent.Pipeline);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void RealignWeaponSlots()
|
||||
{
|
||||
if (_weaponSlots == null || _player == null) return;
|
||||
|
||||
for (int i = 0; i < _weapons.Count; i++)
|
||||
{
|
||||
if (i < _weaponSlots.Length && _weapons[i] != null)
|
||||
{
|
||||
GameEntry.Entity.AttachEntity(_weapons[i].Id, _player.Id, _weaponSlots[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool CanCombineWeapon(int index, out int matchIndex, out WeaponConfig nextTierConfig)
|
||||
{
|
||||
matchIndex = -1;
|
||||
nextTierConfig = null;
|
||||
|
||||
if (_weapons == null || index < 0 || index >= _weapons.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WeaponBase target = _weapons[index];
|
||||
if (target?.WeaponData == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!WeaponUtility.TryGetNextTierConfig(target.WeaponData.Config, out nextTierConfig))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < _weapons.Count; i++)
|
||||
{
|
||||
if (i == index) continue;
|
||||
WeaponBase other = _weapons[i];
|
||||
if (other?.WeaponData == null) continue;
|
||||
|
||||
if (other.WeaponData.WeaponType == target.WeaponData.WeaponType &&
|
||||
other.WeaponData.Rarity == target.WeaponData.Rarity)
|
||||
{
|
||||
matchIndex = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool AttachProp(PropItem prop)
|
||||
{
|
||||
_props.Add(prop);
|
||||
|
||||
Reference in New Issue
Block a user