mathe/Library/PackageCache/com.unity.visualscripting@1.9.0/Editor/VisualScripting.State/Transitions/StateTransitionAnalyser.cs

28 lines
776 B
C#
Raw Normal View History

2024-09-20 20:30:10 +02:00
using System.Collections.Generic;
namespace Unity.VisualScripting
{
public abstract class StateTransitionAnalyser<TStateTransition> : Analyser<TStateTransition, StateTransitionAnalysis>
where TStateTransition : IStateTransition
{
protected StateTransitionAnalyser(GraphReference reference, TStateTransition target) : base(reference, target) { }
public TStateTransition transition => target;
[Assigns]
protected virtual bool IsTraversed()
{
return true;
}
[Assigns]
protected virtual IEnumerable<Warning> Warnings()
{
if (!IsTraversed())
{
yield return Warning.Info("Transition is never traversed.");
}
}
}
}