Dependencies
Dependencies
Dependencies allow you to define conditions that a buildable relies on to avoid being destroyed. To implement a dependency, subclass the UBF_Dependency class and override the Name function to set up the logic. If the function returns true, the dependency passes; if it returns false, the buildable will be destroyed.
Properties:
bIsMandatoryDetermines whether this dependency is required for success.TrueThis dependency must pass. If it fails, the entire check fails, regardless of other dependencies.FalseThis dependency can fail as long as other dependencies succeed.
OwningBuildableHolds a reference to the buildable that owns this dependency.
Functions:
IsMandatory()Returns whether the dependency is mandatory for the buildable.DependencyCondition()Override this function to define the specific condition for the dependency. It returnstrueif the dependency passes, andfalseif it fails.InitializeDependency()Used to initialize any specific logic for the dependency. By default, this function does nothing unless overridden. You should set up bindings for other delegates or event dispatchers here.
Last updated