2026-05-10 11:47:55 -04:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
2026-05-23 08:27:50 -04:00
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
2026-05-10 11:47:55 -04:00
|
|
|
{
|
|
|
|
|
public partial class FutureWand : MainWeaponBase
|
|
|
|
|
{
|
|
|
|
|
private bool _isHoldingAttack;
|
|
|
|
|
|
2026-06-27 12:52:03 -04:00
|
|
|
private Transform Muzzle => viewObjects["Wand"].functionalParts["Muzzle"].transform;
|
|
|
|
|
|
2026-05-10 11:47:55 -04:00
|
|
|
public override void OnEquipped()
|
|
|
|
|
{
|
|
|
|
|
base.OnEquipped();
|
2026-07-18 03:16:20 -04:00
|
|
|
CacheExtenderFlags();
|
2026-05-10 11:47:55 -04:00
|
|
|
RegisterFunctionsToAnimSc();
|
|
|
|
|
viewObjects["Wand"].SetFadeAnim(0.5f);
|
2026-06-27 12:52:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnUnequipped()
|
|
|
|
|
{
|
2026-07-18 03:16:20 -04:00
|
|
|
// 注销受击事件,避免内存泄漏。
|
2026-06-27 12:52:03 -04:00
|
|
|
player.eventSm.onGetHit.Remove(nameof(FutureWand));
|
|
|
|
|
|
2026-07-18 03:16:20 -04:00
|
|
|
StopSpinAreaCharge();
|
|
|
|
|
RecallAllSpinAreas();
|
2026-06-27 12:52:03 -04:00
|
|
|
base.OnUnequipped();
|
2026-05-10 11:47:55 -04:00
|
|
|
}
|
2026-06-12 17:11:39 -04:00
|
|
|
|
|
|
|
|
public override void OnSwitchIn()
|
|
|
|
|
{
|
2026-07-18 03:16:20 -04:00
|
|
|
if(!player.inputSc.IsMoving)
|
2026-05-10 11:47:55 -04:00
|
|
|
{
|
2026-07-18 03:16:20 -04:00
|
|
|
PlayTargetedAnimation("Equip", RefreshPrimaryTarget());
|
2026-05-10 11:47:55 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-18 03:16:20 -04:00
|
|
|
public override void OnSwitchOut()
|
2026-05-10 11:47:55 -04:00
|
|
|
{
|
2026-07-18 03:16:20 -04:00
|
|
|
base.OnSwitchOut();
|
|
|
|
|
StopSpinAreaCharge();
|
|
|
|
|
RecallAllSpinAreas();
|
2026-05-10 11:47:55 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|