当前位置:   article > 正文

ue4 隐藏actor SetActorHiddenInGame_setactortickenabled

setactortickenabled

1 新建class类MyActor

2 MyActor.h

  1. // Fill out your copyright notice in the Description page of Project Settings.
  2. #pragma once
  3. #include "CoreMinimal.h"
  4. #include "GameFramework/Actor.h"
  5. #include "MyActor.generated.h"
  6. UCLASS()
  7. class ROTATE_API AMyActor : public AActor
  8. {
  9. GENERATED_BODY()
  10. public:
  11. // Sets default values for this actor's properties
  12. AMyActor();
  13. protected:
  14. // Called when the game starts or when spawned
  15. virtual void BeginPlay() override;
  16. public:
  17. // Called every frame
  18. virtual void Tick(float DeltaTime) override;
  19. UPROPERTY(EditAnywhere, Category = "Disable")
  20. bool HideInGame;
  21. UFUNCTION(BlueprintCallable, Category = "Disable")
  22. void DisableActor(bool toHide);
  23. };

MyActor.cpp

  1. // Fill out your copyright notice in the Description page of Project Settings.
  2. #include "MyActor.h"
  3. // Sets default values
  4. AMyActor::AMyActor()
  5. {
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/133376
推荐阅读
相关标签
  

闽ICP备14008679号