Implement interaction prompt
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import unreal
|
||||
|
||||
|
||||
def load(path):
|
||||
asset = unreal.EditorAssetLibrary.load_asset(path)
|
||||
if not asset:
|
||||
raise RuntimeError(f"Could not load {path}")
|
||||
return asset
|
||||
|
||||
|
||||
def main():
|
||||
game_mode_bp = load("/Game/ThirdPerson/Blueprints/BP_ThirdPersonGameMode")
|
||||
game_mode_cdo = unreal.get_default_object(game_mode_bp.generated_class())
|
||||
hud_class = unreal.load_class(None, "/Script/AgrarianGame.AgrarianDebugHUD")
|
||||
if not hud_class:
|
||||
raise RuntimeError("Could not load /Script/AgrarianGame.AgrarianDebugHUD")
|
||||
|
||||
game_mode_cdo.set_editor_property("hud_class", hud_class)
|
||||
unreal.EditorAssetLibrary.save_loaded_asset(game_mode_bp)
|
||||
|
||||
unreal.log("Agrarian interaction prompt setup complete.")
|
||||
|
||||
|
||||
main()
|
||||
Reference in New Issue
Block a user