码迷,mamicode.com
首页 > 编程语言 > 详细

UE 用C++ 扩展FunctionLibrary 蓝图以供全局函数使用

时间:2019-02-19 14:59:29      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:function   printf   使用   public   esc   project   plink   ext   ring   

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBPCallFunction.generated.h"



DEFINE_LOG_CATEGORY_STATIC(myLog, Log, All);
//UE_LOG(myLog,Log,TEXT("name = %s"),*customName);


/**
 * 
 */

UCLASS()
class CREATEBPLINKLIB_API UMyBPCallFunction : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()


public:
	UFUNCTION(BlueprintCallable,Category="Custom|myfun")
	static void GetCustomName(FString& myName);
	
	/*
	abc
	*/
	UFUNCTION(BlueprintCallable,Category="Custom|myfun")
	static void SetCustomName(FString setName,FString& custom);
};

  

// Fill out your copyright notice in the Description page of Project Settings.

#include "Public/MyBPCallFunction.h"

void UMyBPCallFunction::GetCustomName(FString& myName)
{
	myName = "hello!";
}


void UMyBPCallFunction::SetCustomName(FString setName,FString& customName)
{
	//customName = setName;
	customName = setName.Append("abc");	
	UE_LOG(myLog,Log,TEXT("name = %s"),*customName);
}

  

UE 用C++ 扩展FunctionLibrary 蓝图以供全局函数使用

标签:function   printf   使用   public   esc   project   plink   ext   ring   

原文地址:https://www.cnblogs.com/mayichen0823/p/10401021.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!