当前位置:网站首页>U++ learning notes ustruct, uenum declaration and function library simple function implementation
U++ learning notes ustruct, uenum declaration and function library simple function implementation
2022-07-26 01:20:00 【It's a bald rabbit】
.h:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBlueprintFunctionLibrary.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FTest {
GENERATED_BODY()
UPROPERTY(EditAnywhere, Category = "Analytics")
int32 value1;
UPROPERTY(EditAnywhere, Category = "Analytics")
int32 value2;
};
UENUM(BlueprintType)
enum class EMyEnum : uint8 {
value1,
value2
};
UCLASS()
class FLOATINGCUBE_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = "Analytics")
static FTest DoSwap(const int32 &value1, const int32 &value2, int32& valueout1, int32& valueout2);//& Output for function ,const & Enter constants for
UFUNCTION(BlueprintCallable, Category = "Analytics")
static bool AnotherDoSwap(int32 value1, int32 value2);
};
.cpp:
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyBlueprintFunctionLibrary.h"
FTest UMyBlueprintFunctionLibrary::DoSwap(const int32 &value1, const int32 &value2, int32& valueout1, int32& valueout2) {
valueout1 = value2;
valueout2 = value1;
FTest ftest;
ftest.value1 = valueout1;
ftest.value2 = valueout2;
return ftest;
}
bool UMyBlueprintFunctionLibrary::AnotherDoSwap(int32 value1, int32 value2) {
value1 ^= value2;
value2 ^= value1;
value1 ^= value2;
return true;
}Achieve results :

Do Swap in value1、2 Medium is in the code const int32 &value1、2,int& valueout1 by Do Swap Output right of .return Is the return value structure .
边栏推荐
- 数据库系统原理与应用教程(056)—— MySQL 查询(十八):其他类型函数的用法
- Sqli-labs Less7
- Tencent employees' salary: the real 985 graduation salary, do you think I can be saved? Netizen: daily salary?
- Subarray with 19 and K
- Failed to load DLL
- 数据库系统原理与应用教程(057)—— MySQL 练习题
- 《自然语言处理实战入门》深度学习基础 ---- attention 注意力机制 ,Transformer 深度解析与学习材料汇总
- API测试简介
- 健身房一年关店8000家,逆势盈利的工作室是怎么开的?
- 力扣 25. K 个一组翻转链表
猜你喜欢

Sqli-labs Less7

Leetcode537. 复数乘法(可以,已解决)

IP地址能精确到哪步?动态IP及静态IP是什么?切换IP最常用的方法

动态IP地址是什么?为什么大家会推荐用动态ip代理?

NLP introduction + practice: Chapter 4: using pytorch to manually realize linear regression

NodeJS 基于 Dapr 构建云原生微服务应用,从 0 到 1 快速上手指南

EasyRecovery15下载量高的恢复率高的数据恢复软件

NIO简易示例

Special topic of distributed micro service e-commerce (I) - Project Introduction

The gym closes 8000 stores a year. How does the studio that bucks the trend and makes profits open?
随机推荐
NLP introduction + practice: Chapter 3: gradient descent and back propagation
matlab 移位操作基础
如何获取广告服务流量变现数据,助力广告效果分析?
[RTOS training camp] about classes and Q & A
谷歌浏览器调试工具使用基础版(一)
Machine learning: Bayesian Networks
Zero copy of network file transfer
Diablo: immortality mobile game how to open more brick moving and novice introduction brick moving strategy
聚势|海泰方圆亮相第五届数字中国建设峰会
NiO simple example
[RTOS training camp] course learning methods and structural knowledge review + linked list knowledge
Tutorial on the principle and application of database system (057) -- MySQL exercises
Inverse matrix block matrix
Google Gson用法详解
Iftnews | suppose this is what the metauniverse looks like 20 years later
FastJson 处理泛型
[CTF] crypto preliminary basic outline
记一次自定义 Redis 分布式锁导致的故障
Cross linguistic transfer of correlations between parts of speech and Gazette Features Reading Notes
换ip软件的用途很广及原理 动态IP更换的四种方法来保护网络隐私