private UnitOptionTree GetNewUnitOptions(UnitOptionFilter filter) { var options = new UnitOptionTree(new GUIContent("Unit")); options.filter = filter; options.reference = reference; if (filter.CompatibleOutputType == typeof(object)) { options.surfaceCommonTypeLiterals = true; } return(options); }
public static IEnumerable <IUnitOption> Subset(UnitOptionFilter filter, GraphReference reference) { lock (@lock) { if (options == null) { Load(); } var dynamicOptions = UnityAPI.Await(() => GetDynamicOptions().ToHashSet()); var contextualOptions = UnityAPI.Await(() => GetContextualOptions(reference).ToHashSet()); return(LinqUtility.Concat <IUnitOption>(options, dynamicOptions, contextualOptions) .Where((filter ?? UnitOptionFilter.Any).ValidateOption) .ToArray()); } }