更新
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Cielonos.MainGame.Characters
|
||||
|
||||
[TitleGroup("Data & Presets")]
|
||||
public AttributeData attributeData;
|
||||
public VFXData vfxData;
|
||||
public BaseAnimationGroup baseAnimationGroup;
|
||||
|
||||
[TitleGroup("Submodules")]
|
||||
@@ -50,8 +51,8 @@ namespace Cielonos.MainGame.Characters
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
InitializeSubmodules();
|
||||
InitializeSubcontrollers();
|
||||
InitializeSubmodules();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
@@ -63,6 +64,8 @@ namespace Cielonos.MainGame.Characters
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
vfxData.Initialize(this);
|
||||
|
||||
if (fraction == Fraction.Enemy)
|
||||
{
|
||||
BattleManager.EnemySm.activeEnemiesList.Add(this);
|
||||
@@ -175,16 +178,45 @@ namespace Cielonos.MainGame.Characters
|
||||
|
||||
public partial class CharacterBase
|
||||
{
|
||||
public virtual bool GetHit(BreakthroughType breakthroughType,
|
||||
public virtual bool GetHit(BreakthroughType breakthroughType, out float recoveryTime,
|
||||
DisruptionType disruptionType = DisruptionType.NormalExternal, Vector3 direction = default)
|
||||
{
|
||||
renderSc.GetHitBlink();
|
||||
if (animationSc.SetGetHitDisruption(disruptionType, breakthroughType))
|
||||
{
|
||||
animationSc.PlayGetHitMediumAnimation(direction);
|
||||
switch (breakthroughType)
|
||||
{
|
||||
case BreakthroughType.Medium:
|
||||
animationSc.PlayGetHitMediumAnimation(out recoveryTime, direction);
|
||||
break;
|
||||
case BreakthroughType.Heavy:
|
||||
animationSc.PlayGetHitHeavyAnimation(out recoveryTime,direction);
|
||||
break;
|
||||
case BreakthroughType.Disruption:
|
||||
case BreakthroughType.Forced:
|
||||
animationSc.PlayGetHitDisruptionAnimation(out recoveryTime,direction);
|
||||
break;
|
||||
default:
|
||||
animationSc.PlayGetHitBoneShake(0.4f, direction);
|
||||
recoveryTime = 0f;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
float intensity = breakthroughType switch
|
||||
{
|
||||
BreakthroughType.None => 0,
|
||||
BreakthroughType.Weak => 0.2f,
|
||||
BreakthroughType.Medium => 0.4f,
|
||||
BreakthroughType.Heavy or BreakthroughType.Disruption or BreakthroughType.Forced => 0.8f,
|
||||
_ => 0
|
||||
};
|
||||
|
||||
recoveryTime = 0f;
|
||||
animationSc.PlayGetHitBoneShake(intensity, direction);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user