{
foreach (var type in exclusionList)
if(dg.TryRemove(type, exclusionList))
if(dg.TryExclude(type, exclusionList))
if (GameplayIngredientsSettings.currentSettings.verboseCalls)
Debug.LogWarning($"Manager : Excluded {type} from manager creation");
}
// Try remove a type by its name, if it's not a dependency of another node
public bool TryRemove(string type, string[] exclusionList)
// Try exclude a type by its name, if it's not a dependency of another node
public bool TryExclude(string type, string[] exclusionList)
// If type is not excluded and our type is a dependency, then we can't remove the node
if (!exclusionList.Contains(node.target.Name) && IsDependentOn(node.target, n.target))
if (node == n)
continue;
// If type our type is a dependency or is already excluded, then we don't remove the node
if (IsDependentOn(node.target, n.target) || exclusionList.Contains(node.target.Name))
nodes.Remove(n);
n.excluded = true;
return true;
foreach(var node in nodes)
if (node.excluded)
if (!d.ContainsKey(node.target))
d.Add(node.target, 0);
else
if (dep.excluded)
if (!d.ContainsKey(dep.target))
d.Add(dep.target, 0);
public List<DependencyNode> dependencies;
public readonly Type target;
public bool excluded;
this.excluded = false;
public override string ToString()