You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
867 B
30 lines
867 B
2 years ago
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Unity.VisualScripting
|
||
|
{
|
||
|
[Analyser(typeof(INesterState))]
|
||
|
public class NesterStateAnalyser<TNesterState> : StateAnalyser<TNesterState>
|
||
|
where TNesterState : class, INesterState
|
||
|
{
|
||
|
public NesterStateAnalyser(GraphReference reference, TNesterState state) : base(reference, state) { }
|
||
|
|
||
|
protected override IEnumerable<Warning> Warnings()
|
||
|
{
|
||
|
foreach (var baseWarning in base.Warnings())
|
||
|
{
|
||
|
yield return baseWarning;
|
||
|
}
|
||
|
|
||
|
if (state.childGraph == null)
|
||
|
{
|
||
|
yield return Warning.Caution("Missing nested graph.");
|
||
|
}
|
||
|
|
||
|
if (state.nest.hasBackgroundEmbed)
|
||
|
{
|
||
|
yield return Warning.Caution("Background embed graph detected.");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|