在Actor内创建一个StaticMesh

#include "Components/StaticMeshComponent.h"
#include "Engine/StaticMesh.h"
auto comp1 = CreateDefaultSubobject<UStaticMeshComponent>("Cube");
ConstructorHelpers::FObjectFinder<UStaticMesh> sm(TEXT("/Engine/BasicShapes/Cube.Cube"));
comp1->SetStaticMesh(sm.Object);
comp1->SetWorldScale3D(FVector(0.5));
comp1->SetupAttachment(RootComponent);

用UE宏实现委托

https://blog.csdn.net/yangxuan0261/article/details/52097699

1 DECLARE_DELEGATE(FTimerDelegate);

2 #define DECLARE_DELEGATE( DelegateName ) FUNC_DECLARE_DELEGATE( DelegateName, void );

3 #define FUNC_DECLARE_DELEGATE( DelegateName, ... ) \ typedef TBaseDelegate<__VA_ARGS__> DelegateName;

相当于 TBaseDelegate FTimerDelegate

KismetSystemLibrary

UKismetSystemLibrary::Delay(this, HitDelayTime, FLatentActionInfo(16, 2147483647, TEXT("方法名"), this));//这个延时执行一个方法

动态加载

LoadObject 在 Object.h内 不用找头文件了,动态加载 GO

设置模型碰撞

SMC = CreateDefaultSubobject<UStaticMeshComponent>("SMC");
ConstructorHelpers::FObjectFinder<UStaticMesh> sm(TEXT("/Game/Code/Cell/CellMs.CellMs"));//查找模型加载
SMC->SetStaticMesh(sm.Object);
SMC->AttachTo(RootComponent);
SMC->CastShadow = false;
SMC->SetCollisionProfileName(UCollisionProfile::CustomCollisionProfileName);//自定义碰撞配置文件
SMC->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);//忽略所有通道
SMC->SetCollisionObjectType(ECollisionChannel::ECC_WorldStatic);//世界静态碰撞对象
SMC->SetCollisionResponseToChannel(ECollisionChannel::ECC_GameTraceChannel5, ECollisionResponse::ECR_Block);//使用自定义通道

其他

PlayerContorller set enable click event 启用鼠标点击事件

UE4代码片断备份的更多相关文章

  1. Sublime Text 2 代码片断

    原文:Snippets 不管是在编码,还是写畅销书,你都可能会需要一遍又一遍的用到一些文本的小片断.使用片断来结束这种单调无聊的码字吧,片断是一种智能的模板,它能在合适的上下文中插入你需要的文本内容. ...

  2. gerrit代码简单备份方案分享

    由于前期部署了gerrit代码审核系统,开发调整后的线上代码都放到gerrit上,这就要求我们要保证代码的安全.所以,对gerrit代码的备份至关重要! 备份的策略是:1)先首次将gerrit项目代码 ...

  3. vs2017通过snippet代码片断进行标准化注释

    我们在进行团队开发时,类的注释已经可以做到自定义了,详细看上篇文章<vs2017通过模块文件添加自定义注释>,而对于方法的注释,我们也需要完善一下,这里我们用到了“代码片断”插件,VS里有 ...

  4. UE4 代码编写细节:静态变量

    Note:因为在切换关切时,会GC掉所有GameThread线程下的Object类,如果Static是UOBject 请调用AddToRoot函数  当然如果你的UObject子类Object是在自己 ...

  5. 一个简单的dos脚本, svn 获取代码 - Tomcat 备份 - Maven 编译 - 停止/启动Tomcat - Tomcat站点 发布

    获取最新代码 svn update --username %SVN_USER% --password %SVN_PASSWORD% >> "../%LOG_FILE%" ...

  6. 看代码网备份|利用WebClient|eKing.CmdDownLoadDbBakOper|实现定时拷贝数据库备份文件到文件服务器

    摘要: 1.有两台服务器 (1)看代码网(记为A):内网IP:10.186.73.30 (2)文件服务器(记为B):内网IP:10.135.87.157 2.在A架设一个网站,端口8088(防火强设置 ...

  7. ue4 代码入门

    官网:暴露游戏元素给蓝图 https://docs.unrealengine.com/latest/CHN/Engine/Blueprints/TechnicalGuide/ExtendingBlue ...

  8. 类ExampleA继承Exception,类ExampleB继承ExampleA。 有如下代码片断:

    try { throw new ExampleB("b") } catch(ExampleA e){ System.out.println("ExampleA" ...

  9. XCode的代码块备份

    以上三个的注释可以从下面的代码依据个数拷贝和删除: /** * <#comment#> * * @param <#one#> * * @param <#two#> ...

随机推荐

  1. Docker容器镜像删除

    好吧,本来认为删除镜像是一件很容易的事情,但刚开始上手,还是有点百思不得其解.删着删着,发现果然很容易.分享下本人的心得: 分两种情况:那么要删除镜像,首先得删除容器,删除容器时,确保容器已停止运行: ...

  2. Copula函数

    Copula函数 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 1. Copula介绍 Copula函数把边缘分布函数与联合分布函数联系起来,是研究变 ...

  3. dicom错误解决

    https://github.com/pydicom/pydicom/issues/331 sudo apt-get install python-gdcm

  4. 发布时一键添加html中的css标签和script标签版本号来防止浏览器缓存

    AppendFileVersion 是一个VSIX插件支持vs2015意以上版本 是我用来发布时一键添加html中的css标签和script标签版本号来防止浏览器缓存 分享给大家! download ...

  5. Vue echarts

    方式一.直接引入echarts 先 npm 安装 echarts npm install echarts --save // main.js import myCharts from './comm/ ...

  6. Education CodeForces Round 63 Div.2

    A. Reverse a Substring 代码: #include <bits/stdc++.h> using namespace std; int N; string s; int ...

  7. [C++项目]2048控制台游戏

    #include <iostream> #include <windows.h> #include <ctime> using namespace std; ; ; ...

  8. java数组2

    package lastt; public class last { String name;int age; public last(String name,int age) { this.name ...

  9. Python——内置函数

    一.min函数 取当前字符串的最小字符串 s1 = min(strs) 二.max函数 取当前字符串的最大字符串 s1 = max(strs) 三.enumerate函数 函数用于将一个可遍历的数据对 ...

  10. 【python 字符串】 字符串的相关方法(二)

    查找元素所在的第一个的索引位置    text.find() 可有开始和结束位置查找  find('ex',3,6) # 查找元素的索引位置 text = 'alexalex' ret = text. ...