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:
bIsMandatory
Determines whether this dependency is required for success.True
This dependency must pass. If it fails, the entire check fails, regardless of other dependencies.False
This dependency can fail as long as other dependencies succeed.
OwningBuildable
Holds 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 returnstrue
if the dependency passes, andfalse
if 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