7PYVWF7I4JWTDZ5M7Q5BCKGEICUXHXKWEYQB4OGUXZE5VBJ45PBQC
QAZ3YAYCPNY45B4NZDRONZ5RHAYNAKDG7PZUNHUHAVU2LTJ5XCVAC
5I5QA3YK5G5QQCXMSDOEAX3A74LVXV7PYWAIHMLFANR2GUFWMKGQC
SXUEBCCDPGKZIWBSRNELNL75BHYDNWLWXU6QOKYWIWFPLWTOIHHQC
NZIEX6J6Q6DSJKNSCTHNIA6EJDQEGMK3ZSP3LKX2UAEDHURQPRVQC
CD5FF75KTOBTMVMTMCKMR6F5DFKOF26I5K43ITNHGBI3ZAZHA4RAC
CR4K4SCZXUFUUOXTBA4D6HEKQ6TFDLYQPS3OWOKV747LMGHC33SQC
[SerializeField] List<CombatFormRef> knownForms;
Weapon _equipedWeapon;
[SerializeField] List<CombatFormRef> _knownForms;
Weapon _equippedWeapon;
CombatForm _equippedForm;
Dictionary<Weapon, CombatForm> _preferedCombatFormByWeapon = new Dictionary<Weapon, CombatForm>();
}
private void SetCombatForm(CombatForm combatForm) {
_equippedForm = combatForm;
OnCombatFormEquipped?.Invoke(this, new CombatFormEquippedArgs(_equippedForm, this));
}
private void EquipPreferredCombatFormOfWeapon(Weapon weapon) {
_preferedCombatFormByWeapon.TryGetValue(weapon, out CombatForm tryEquipForm);
SetCombatForm(tryEquipForm);
_equipedWeapon = tryEquipWeapon;
OnWeaponEquipped?.Invoke(this, new WeaponEquippedArgs(_equipedWeapon, this));
_equippedWeapon = tryEquipWeapon;
OnWeaponEquipped?.Invoke(this, new WeaponEquippedArgs(_equippedWeapon, this));
EquipPreferredCombatFormOfWeapon(_equippedWeapon);
sb.Append(String.Format($"PrintEquipedWeaponDebug (equipedWeapon = {_equipedWeapon.name})"));
foreach (var form in _equipedWeapon.GetCompatibleForms()) {
sb.Append(String.Format($"PrintEquipedWeaponDebug (equipedWeapon = {_equippedWeapon.name})"));
foreach (var form in _equippedWeapon.GetCompatibleForms()) {
public IEnumerable<CombatForm> GetAvailableCombatFormsForEquipedWeapon() => knownForms.Select(combatFormRef => combatFormRef.Value).Intersect(_equipedWeapon.GetCompatibleForms());
public IEnumerable<CombatForm> GetAvailableCombatFormsForEquipedWeapon() => _knownForms.Select(combatFormRef => combatFormRef.Value).Intersect(_equippedWeapon.GetCompatibleForms());
CombatFormSelectUI.OnCombatFormSelected += CombatFormSelectUI_OnCombatFormSelected;
}
private void CombatFormSelectUI_OnCombatFormSelected(object sender, CombatFormSelectedArgs e)
{
if (selectedUnit.TryGetComponent<Weaver>(out Weaver trySelectWeaver)) {
trySelectWeaver.TryEquipCombatForm(e.CombatForm.name);
}
private void SetSelectedCombatFormByName(string combatFormName) {
foreach (Transform combatFormButtonTransform in transform) {
var combatFormSelectUI = combatFormButtonTransform.GetComponent<CombatFormSelectUI>();
if (combatFormSelectUI.GetCombatFormName() == combatFormName) {
combatFormSelectUI.SetSelected();
} else {
combatFormSelectUI.SetNotSelected();
}
}
}
private void Clear() {
foreach (Transform combatFormSelectUI in transform)
{
Destroy(combatFormSelectUI.gameObject);
}
}
- target: {fileID: 1763275424511731206, guid: 689a4763a3cde4b46a7c011ddb15ea97,
type: 3}
propertyPath: _knownForms.Array.data[0]
value:
objectReference: {fileID: 11400000, guid: 6d28336306dbd8f41b717755a0ee572c,
type: 2}
- target: {fileID: 1763275424511731206, guid: 689a4763a3cde4b46a7c011ddb15ea97,
type: 3}
propertyPath: _knownForms.Array.data[1]
value:
objectReference: {fileID: 11400000, guid: 7cd9798399927f44ab0774af3f49897a,
type: 2}