public static void AwaitDependencies(ISerializationDepender depender) { #if DEBUG_DEPENDENCIES Debug.Log($"Awaiting {depender.deserializationDependencies.Count()} dependencies on {depender}\n".Colored(new Color(1, 0.5f, 0)) + $"{depender.deserializationDependencies.ToLineSeparatedString()}\n"); #endif awaitingDependers.Add(depender); CheckIfDependenciesMet(depender); }
private static void CheckIfDependenciesMet(ISerializationDepender depender) { if (availableDependencies.IsSupersetOf(depender.deserializationDependencies)) { awaitingDependers.Remove(depender); #if DEBUG_DEPENDENCIES Debug.Log($"All dependencies met on {depender}.\n".Colored(Color.cyan)); #endif depender.OnAfterDependenciesDeserialized(); } }
private static void CheckIfDependenciesMet(ISerializationDepender depender) { var areDependenciesMet = true; foreach (var requiredDependency in depender.deserializationDependencies) { var weakRequiredDependency = WeakenSerializationDependencyReference(requiredDependency); if (!availableDependencies.Contains(weakRequiredDependency)) { areDependenciesMet = false; break; } } if (areDependenciesMet) { awaitingDependers.Remove(depender); depender.OnAfterDependenciesDeserialized(); } }
public static void AwaitDependencies(ISerializationDepender depender) { awaitingDependers.Add(depender); CheckIfDependenciesMet(depender); }