This commit is contained in:
SoulliesOfficial
2026-01-03 18:19:39 -05:00
parent 3bcd7c1cf8
commit 33b1795c1f
7387 changed files with 2762819 additions and 716926 deletions

View File

@@ -35,7 +35,8 @@ namespace SLSUtilities.FunctionalAnimation
public AnimationClip animationClip;
[Title("编辑时信息")]
public FuncAnimInfo animInfo = new FuncAnimInfo("AnimationName", "StateName", true, DisruptionType.NormalAction, 1.0f, 0, true);
public FuncAnimInfo animInfo = new FuncAnimInfo("AnimationName", "StateName", true, new List<string>(),
DisruptionType.NormalAction, 1.0f, 0, true, new Dictionary<string, List<string>>());
[Title("技能区间")]
[ListDrawerSettings(
@@ -135,6 +136,8 @@ namespace SLSUtilities.FunctionalAnimation
Startup = 10,
[InspectorName("外部打断窗口 (External Disruption)")]
ExternalDisruption = 11,
[InspectorName("强制外部打断窗口 (Forced External Disruption),如果没有此区间,默认整个动作都可被强制打断")]
ForcedExternalDisruption = 12,
[InspectorName("攻击判定 (Active)")]
Active = 20,
[InspectorName("无敌帧 (Invincible)")]

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace SLSUtilities.FunctionalAnimation
@@ -30,6 +31,9 @@ namespace SLSUtilities.FunctionalAnimation
[Tooltip("这个技能是否使用Root Motion?")]
public bool useRootMotion;
[Tooltip("技能的Tag")]
public List<string> tags;
[Tooltip("技能的默认打断类型")]
public DisruptionType disruptionType;
@@ -41,21 +45,26 @@ namespace SLSUtilities.FunctionalAnimation
[Tooltip("技能是否受速度倍率影响 (例如:角色的攻速属性)")]
public bool isAffectedBySpeedMultiplier;
[Tooltip("技能交互标签,用于标记技能与其他系统的交互关系,例如可以用来标记哪些技能可以被特定状态打断等")]
public Dictionary<string, List<string>> interactionTags;
[Tooltip("技能描述,通常是给开发者看的,便于回忆,可以不写,不会在游戏中显示")]
[TextArea]
public string description;
public FuncAnimInfo(string animationName, string stateName, bool useRootMotion, DisruptionType disruptionType,
float overridePlaySpeed, int overrideStartFrame, bool isAffectedBySpeedMultiplier)
public FuncAnimInfo(string animationName, string stateName, bool useRootMotion, List<string> tags, DisruptionType disruptionType,
float overridePlaySpeed, int overrideStartFrame, bool isAffectedBySpeedMultiplier, Dictionary<string, List<string>> interactionTags)
{
this.animationName = animationName;
this.stateName = stateName;
this.useRootMotion = useRootMotion;
this.tags = tags;
this.disruptionType = disruptionType;
this.overridePlaySpeed = overridePlaySpeed;
this.overrideStartFrame = overrideStartFrame;
this.isAffectedBySpeedMultiplier = isAffectedBySpeedMultiplier;
this.interactionTags = interactionTags;
this.description = "";
}
}

View File

@@ -206,6 +206,17 @@ namespace SLSUtilities.FunctionalAnimation
}
}
public bool HasIntervalType(IntervalType type)
{
if (funcAnimData == null || funcAnimData.intervals == null)
{
Debug.LogWarning($"[FuncAnimData.RuntimeInfo] Parent data or intervals list is null.");
return false;
}
return funcAnimData.intervals.Any(interval => interval.intervalType == type);
}
public List<FuncAnimInterval> GetEnablingIntervals() => GetEnablingIntervals(currentPlayTime);
public List<FuncAnimInterval> GetEnablingIntervals(float time)
{
@@ -214,8 +225,12 @@ namespace SLSUtilities.FunctionalAnimation
Debug.LogWarning($"[FuncAnimData.RuntimeInfo] Parent data or intervals list is null.");
return new List<FuncAnimInterval>();
}
return funcAnimData.intervals.Where(interval => time >= interval.StartTime && time <= interval.EndTime).ToList();
return funcAnimData.intervals.Where(interval =>
{
if(Mathf.Approximately(interval.StartTime, interval.EndTime)) return false; //忽略瞬时区间
return time >= interval.StartTime && time <= interval.EndTime; //在区间内
}).ToList();
}
}
}