92 lines
1.9 KiB
C#
92 lines
1.9 KiB
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using BITKit.StateMachine;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace BITFALL.Entities.Equipment.Melee
|
||
|
{
|
||
|
[Serializable]
|
||
|
public sealed class Draw:PlayerMeleeControllerState
|
||
|
{
|
||
|
public override void Initialize()
|
||
|
{
|
||
|
base.Initialize();
|
||
|
meleeController.animator[0].onStateExit += (state) =>
|
||
|
{
|
||
|
if(Enabled && state is BITConstant.Player.Draw)
|
||
|
meleeController.TransitionState<Idle>();
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public override void OnStateEntry(IState old)
|
||
|
{
|
||
|
base.OnStateEntry(old);
|
||
|
meleeController.animator.Play(BITConstant.Player.Draw);
|
||
|
}
|
||
|
}
|
||
|
[Serializable]
|
||
|
public sealed class Idle:PlayerMeleeControllerState
|
||
|
{
|
||
|
|
||
|
}
|
||
|
[Serializable]
|
||
|
public sealed class Run:PlayerMeleeControllerState
|
||
|
{
|
||
|
|
||
|
}
|
||
|
[Serializable]
|
||
|
public sealed class Attack:PlayerMeleeControllerState
|
||
|
{
|
||
|
public override void Initialize()
|
||
|
{
|
||
|
base.Initialize();
|
||
|
meleeController.animator[0].onStateExit += (state) =>
|
||
|
{
|
||
|
if(Enabled && state is BITConstant.Player.Attack)
|
||
|
meleeController.TransitionState<Idle>();
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public override void OnStateEntry(IState old)
|
||
|
{
|
||
|
base.OnStateEntry(old);
|
||
|
meleeController.animator.Play(BITConstant.Player.Attack);
|
||
|
}
|
||
|
}
|
||
|
[Serializable]
|
||
|
public sealed class Charging:PlayerMeleeControllerState
|
||
|
{
|
||
|
public override void Initialize()
|
||
|
{
|
||
|
base.Initialize();
|
||
|
|
||
|
}
|
||
|
|
||
|
public override void OnStateEntry(IState old)
|
||
|
{
|
||
|
base.OnStateEntry(old);
|
||
|
meleeController.animator.Play(BITConstant.Player.Charging);
|
||
|
}
|
||
|
}
|
||
|
[Serializable]
|
||
|
public sealed class HeavyAttack:PlayerMeleeControllerState
|
||
|
{
|
||
|
public override void Initialize()
|
||
|
{
|
||
|
base.Initialize();
|
||
|
meleeController.animator[0].onStateExit += (state) =>
|
||
|
{
|
||
|
if(Enabled && state is BITConstant.Player.HeavyAttack)
|
||
|
meleeController.TransitionState<Idle>();
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public override void OnStateEntry(IState old)
|
||
|
{
|
||
|
base.OnStateEntry(old);
|
||
|
meleeController.animator.Play(BITConstant.Player.HeavyAttack);
|
||
|
}
|
||
|
}
|
||
|
}
|