Optimize code to unreal style

This commit is contained in:
martinluckyrobots
2025-04-07 11:32:45 +08:00
parent 5d8e225db5
commit 4d4026d9ad
19 changed files with 306 additions and 315 deletions

View File

@ -1,5 +1,3 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
@ -7,16 +5,12 @@
#include "SharedDef.h"
#include "MainScreenUserWidget.generated.h"
class UDataTable;
/**
*
*/
UCLASS()
class LUCKYROBOTS_API UMainScreenUserWidget : public UUserWidget
{
GENERATED_BODY()
protected:
virtual void NativeConstruct();
virtual void NativeConstruct() override;
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite)
@ -26,24 +20,29 @@ public:
TArray<FLevelData> LevelDataList;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int iCurrentSelectRobot;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int iCurrentSelectLevel;
int32 CurrentRobotIndex;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int iCurrentSelectQuality;
int32 CurrentLevelIndex;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
int32 CurrentQualityIndex;
public:
UFUNCTION(BlueprintCallable)
void InitData();
UFUNCTION(BlueprintCallable)
void InitRobotData();
UFUNCTION(BlueprintCallable)
void InitLevelData();
UFUNCTION(BlueprintCallable)
FRobotData GetCurrentRobotData();
FRobotData GetCurrentRobotData() const;
UFUNCTION(BlueprintCallable)
FLevelData GetCurrentLevelData();
FLevelData GetCurrentLevelData() const;
UFUNCTION(BlueprintCallable)
void SelectNextRobot();