60 lines
2.1 KiB
C#
60 lines
2.1 KiB
C#
using Sirenix.OdinInspector;
|
|
using SLSUtilities.FunctionalAnimation;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.FunctionalAnimation
|
|
{
|
|
public class SetOutline : FuncAnimPayloadBase
|
|
{
|
|
[Tooltip("是否开启轮廓线")]
|
|
[LabelText("@this.outlineSwitch ? \"Enable Outline\" : \"Disable Outline\"")]
|
|
public bool outlineSwitch = true;
|
|
|
|
[Tooltip("轮廓线类型")]
|
|
[LabelText("Outline Type")]
|
|
[ValueDropdown("GetOutlineTypeValues")]
|
|
public string outlineType = "White";
|
|
private string[] GetOutlineTypeValues() => new string[] { "White", "Orange", "Red", };
|
|
|
|
[Tooltip("是否使用详细设置")]
|
|
public bool detailedSettings = false;
|
|
|
|
[Tooltip("轮廓线宽度")]
|
|
[ShowIf("@this.detailedSettings && this.outlineSwitch")]
|
|
public float outlineWidth = 0.1f;
|
|
|
|
[Tooltip("轮廓线淡入淡出时间")]
|
|
[ShowIf("detailedSettings")]
|
|
public float outlineFadeDuration = 0.1f;
|
|
|
|
public override void Invoke()
|
|
{
|
|
var renderSc = character.renderSc;
|
|
|
|
if (outlineSwitch)
|
|
{
|
|
renderSc.OutlineOn(outlineType, outlineWidth, outlineFadeDuration);
|
|
if (outlineType == "White")
|
|
{
|
|
character.reactionSc.breakthroughResistances[BreakthroughType.Medium].Modify(false);
|
|
}
|
|
else if (outlineType == "Red")
|
|
{
|
|
character.reactionSc.breakthroughResistances[BreakthroughType.Heavy].Modify(true);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
renderSc.OutlineOff(outlineFadeDuration);
|
|
if (outlineType == "White")
|
|
{
|
|
character.reactionSc.breakthroughResistances[BreakthroughType.Medium].Modify(true);
|
|
}
|
|
else if (outlineType == "Red")
|
|
{
|
|
character.reactionSc.breakthroughResistances[BreakthroughType.Heavy].Modify(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |