7069人加入学习
(30人评价)
Unreal入门第一季 - 虚幻C++基础训练

制作完成于2019.8.27,基于Unreal 4.22

价格 免费

408

1.不要将UStaticMesh * MyStaticMesh的UPROPERTY()设置为EditAnywhere,不然会有意想不到的效果

2.在FVector TickLocationOffset变量的UPROPERTY()中添加:

meta=(ClampMin=-5.0f,ClampMax=5.0f,UIMin=-5.0f,UIMax=5.0f)

[展开全文]

//在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;

 

};

[展开全文]

限制范围:

meta=(ClampMin = float,ClampMax = float,UIMin = float, UIMax = float)

[展开全文]

授课教师

SiKi学院讲师

课程特色

视频(49)
下载资料(1)