45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Inventory.Collections
|
|
{
|
|
public partial class FutureWand : MainWeaponBase
|
|
{
|
|
private bool _isHoldingAttack;
|
|
|
|
private Transform Muzzle => viewObjects["Wand"].functionalParts["Muzzle"].transform;
|
|
|
|
public override void OnEquipped()
|
|
{
|
|
base.OnEquipped();
|
|
CacheExtenderFlags();
|
|
RegisterFunctionsToAnimSc();
|
|
viewObjects["Wand"].SetFadeAnim(0.5f);
|
|
}
|
|
|
|
public override void OnUnequipped()
|
|
{
|
|
// 注销受击事件,避免内存泄漏。
|
|
player.eventSm.onGetHit.Remove(nameof(FutureWand));
|
|
|
|
StopSpinAreaCharge();
|
|
RecallAllSpinAreas();
|
|
base.OnUnequipped();
|
|
}
|
|
|
|
public override void OnSwitchIn()
|
|
{
|
|
if(!player.inputSc.IsMoving)
|
|
{
|
|
PlayTargetedAnimation("Equip", RefreshPrimaryTarget());
|
|
}
|
|
}
|
|
|
|
public override void OnSwitchOut()
|
|
{
|
|
base.OnSwitchOut();
|
|
StopSpinAreaCharge();
|
|
RecallAllSpinAreas();
|
|
}
|
|
}
|
|
}
|