🔫CoopGame07-增强道具

type
status
date
slug
summary
tags
category
icon
password
跟随B站up主“技术宅阿棍儿”的教程制作的笔记。教程链接 #加速道具 ###0.导入素材,导入最新工程版本的Powerups文件夹 ###1.创建拾取物类 1.创建继承ActorC++类SPickUpActorC++类,相当于道具的底座。
SPickupActor.h
SPickupActor.cpp
2.创建继承ActorC++类的SPowerUpActorC++类,实际作用的道具。
SPowerUpActor.h
SPowerUpActor.cpp
###2.修改SPickUpActor类
1.创建SPickUpActor类继承Actor类,相当于道具的底座。
SPickupActor.h
SPickupActor.cpp
###3.制作贴花材质M_PowerupDecal
蓝图如图
notion image
1.指定贴画材质M_PowerupDecal ###5.创建继承PowerUpActorC++类的BP_PowerUpBase蓝图类。 1.手动添加静态网格体组件,并关闭静态网格体的碰撞预设,设置为NoCollision。 ###4.创建继承BP_PowerUpBase蓝图类的Powerup_SuperSpeed蓝图类。 1指定SpeedIcon静态网格体, 2.蓝图编写如图
notion image
3.制作加速道具的材质M_Powerup和材质实例MI_PowerupSpeed。
M_Powerup
notion image
MI_PowerupSpeed
notion image
4.制作光源函数材质M_PowerupLightFunction并使用,关闭影子
notion image
添加点光源组件,并设置光照函数为M_PowerupLightFunction,关闭阴影,设置光照颜色为蓝色
notion image
notion image
#加血道具 ###1.给健康组件
添加回血函数
SHealthComponent.h
SHealthComponent.cpp
###1.创建继承BP_PowerUpBase蓝图类的Powerup_HealthRegen蓝图类。
1.手动添加并选择静态网格体,添加浮点型变量HealAmount,设置默认值为20。 2.编写蓝图逻辑
notion image
3.修改PickUpActor.h,意思是放置在场景中的蓝图类,在放置之后用场景中的实例指定更好,比如每个道具的冷却时间不同,要生成的道具的种类不同,在放置后设置。
SPowerUpActor.cpp
SPickUpActor.h
SpickUpActor.cpp
###2.修改蓝图类
,用道具基类实现道具显示和销毁逻辑
notion image
###3.修改蓝图类
notion image
###4.修改蓝图类
,修改为玩家群体加血
notion image
###5.实现联机的单人加速(需要指定道具作用的对象,获取玩家Pawn只能获取到玩家0,思路是在玩家重叠道具的时候传那个OtherActor)
1.SPowerUpActor.h
2.SPowerUpActor.cpp
3.SPickUpActor.cpp
4.修改蓝图类
notion image
Prev
CoopGame06-AI基础
Next
CoopGame08-游戏模式
Loading...
Catalog