Skip to content

Commit

Permalink
add BPPostInitializeComponents and BPPreInitializeComponents (#224) (#…
Browse files Browse the repository at this point in the history
…227)

* add BPPostInitializeComponents and BPPreInitializeComponents

* add ROSNamespace append

Co-authored-by: yuokamoto <[email protected]>
  • Loading branch information
github-actions[bot] and yuokamoto authored Nov 13, 2023
1 parent 66c2441 commit b0aee0d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Binary file modified Content/Tools/RRGeneralUtility.uasset
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ void ARRBaseRobot::PreInitializeComponents()
"probably later in child BP class!"));
}

BPPreInitializeComponents();

// Super::, for EAutoPossessAI::PlacedInWorldOrSpawned, spawn APawn's default controller,
// which does the possessing, thus must be called afterwards
Super::PreInitializeComponents();
Expand All @@ -183,6 +185,8 @@ void ARRBaseRobot::PostInitializeComponents()
{
InitMoveComponent();
}

BPPostInitializeComponents();
}

void ARRBaseRobot::SetBaseMeshComp(UMeshComponent* InBaseMeshComp, bool bInMakeAsRoot, bool bInDestroyDefaultRoot)
Expand Down
16 changes: 16 additions & 0 deletions Source/RapyutaSimulationPlugins/Public/Robots/RRBaseRobot.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,22 @@ class RAPYUTASIMULATIONPLUGINS_API ARRBaseRobot : public ARRBaseActor
*/
virtual bool InitMoveComponent();

/**
* @brief This method is called inside #PreInitializeComponents.
* Custom initialization of child BP class can be done by overwritting this method.
* @note BlueprintImplementableEvent can't return value
*/
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void BPPreInitializeComponents();

/**
* @brief This method is called inside #PreInitializeComponents.
* Custom initialization of child BP class can be done by overwritting this method.
* @note BlueprintImplementableEvent can't return value
*/
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void BPPostInitializeComponents();

public:
/**
* @brief Parse Json parameters in #ROSSpawnParameters
Expand Down

0 comments on commit b0aee0d

Please sign in to comment.