添加tickactor,没成功
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#include "TSUserWidget.h"
|
||||
|
||||
void UTSUserWidget::SetTypeScriptTickFunction(FString FunctionName)
|
||||
{
|
||||
TSTickFunctionName = FunctionName;
|
||||
}
|
||||
|
||||
void UTSUserWidget::NativeTick(const FGeometry& MyGeometry, float InDeltaTime)
|
||||
{
|
||||
Super::NativeTick(MyGeometry, InDeltaTime);
|
||||
|
||||
// 这里可以调用TypeScript中注册的Tick函数
|
||||
// 具体实现方式需要根据您的Puerts配置来调用
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "TSUserWidget.generated.h"
|
||||
|
||||
UCLASS()
|
||||
class MINGSIMULATOR_API UTSUserWidget : public UUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable, Category = "TypeScript")
|
||||
void SetTypeScriptTickFunction(FString FunctionName);
|
||||
|
||||
virtual void NativeTick(const FGeometry& MyGeometry, float InDeltaTime) override;
|
||||
|
||||
private:
|
||||
FString TSTickFunctionName;
|
||||
};
|
||||
Reference in New Issue
Block a user