Download LyraStarterGame/Source/LyraGame/GameModes/LyraBotCreationComponent.h from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.76 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/GameModes/LyraBotCreationComponent.h
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Source/LyraGame/GameModes/LyraBotCreationComponent.h
-
curl -L -o LyraBotCreationComponent.h https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Source/LyraGame/GameModes/LyraBotCreationComponent.h
1.76 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class ULyraExperienceDefinition; | |
| class ULyraPawnData; | |
| class AAIController; | |
| UCLASS(Blueprintable, Abstract) | |
| class ULyraBotCreationComponent : public UGameStateComponent | |
| { | |
| GENERATED_BODY() | |
| public: | |
| ULyraBotCreationComponent(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); | |
| //~UActorComponent interface | |
| virtual void BeginPlay() override; | |
| //~End of UActorComponent interface | |
| private: | |
| void OnExperienceLoaded(const ULyraExperienceDefinition* Experience); | |
| protected: | |
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Gameplay) | |
| int32 NumBotsToCreate = 5; | |
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Gameplay) | |
| TSubclassOf<AAIController> BotControllerClass; | |
| UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Gameplay) | |
| TArray<FString> RandomBotNames; | |
| TArray<FString> RemainingBotNames; | |
| protected: | |
| UPROPERTY(Transient) | |
| TArray<TObjectPtr<AAIController>> SpawnedBotList; | |
| /** Always creates a single bot */ | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Gameplay) | |
| virtual void SpawnOneBot(); | |
| /** Deletes the last created bot if possible */ | |
| UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Gameplay) | |
| virtual void RemoveOneBot(); | |
| /** Spawns bots up to NumBotsToCreate */ | |
| UFUNCTION(BlueprintNativeEvent, BlueprintAuthorityOnly, Category=Gameplay) | |
| void ServerCreateBots(); | |
| public: | |
| void Cheat_AddBot() { SpawnOneBot(); } | |
| void Cheat_RemoveBot() { RemoveOneBot(); } | |
| FString CreateBotName(int32 PlayerIndex); | |
| }; | |