//在Editor中限制最大值,最小时
UPROPERTY(EditDefaultsOnly, Category = "My Actor Propertys | Vector", meta = (ClampMin = -5.0f, ClampMax = 5.0f, UIMin = -5.0f, UIMax = 5.0f)
UCLASS()
class STATICMESHSAMPLE_API AMyActor : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AMyActor();
UPROPERTY(VisibleAnyWhere, Category = "My Actor Components")
UStaticMeshComponent *StaticMesh;
//大多数属性都有 Edit 和 Visible, 但是 VisiableAnyWhere 不推荐使用 Edit 属性
UPROPERTY(EditInstanceOnly, Category = "My Actor Propertys | Vector")
FVector InitLocation;
UPROPERTY(VisibleInstanceOnly, Category = "My Actor Propertys | Vector")
FVector PacedLocation;
UPROPERTY(EditDefaultsOnly, Category = "My Actor Propertys | Vector")
bool bGotoInitLocation;
UPROPERTY(VisibleDefaultsOnly, Category = "My Actor Propertys | Vector")
FVector WorldOrigin;
UPROPERTY(EditAnywhere, Category = "My Actor Propertys | Vector", meta = (ClampMin = -5.0f, ClampMax = 5.0f, UIMin = -5.0f, UIMax = 5.0f))
FVector TickLocationOffset;
UPROPERTY(EditAnywhere, Category = "My Actor Propertys | Vector")
bool ShouldMove;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};