当前位置: 首页 > news >正文

个人网站备案能做宣传用么网站开发主要学些什么软件

个人网站备案能做宣传用么,网站开发主要学些什么软件,网络设计与实施课程设计,北京品牌建设网站公司前面几节文章介绍了如何在角色身上添加AbilitySystemComponent和AttributeSet。并且还实现了给AttributeSet添加自定义属性。接下来#xff0c;实现一下如何去修改角色身上的Attribute的值。 实现拾取药瓶回血功能 首先创建一个继承于Actor的c类#xff0c;actor是可以放置到…前面几节文章介绍了如何在角色身上添加AbilitySystemComponent和AttributeSet。并且还实现了给AttributeSet添加自定义属性。接下来实现一下如何去修改角色身上的Attribute的值。 实现拾取药瓶回血功能 首先创建一个继承于Actor的c类actor是可以放置到场景中的基类。 UPROPERTY(VisibleAnywhere)TObjectPtrUStaticMeshComponent Mesh;创建一个静态模型组件用来显示当前可拾取物的模型。 UPROPERTY(VisibleAnywhere)TObjectPtrUSphereComponent Sphere;创建一个碰撞体球用于检测和主角的碰撞来触发回调。 Mesh CreateDefaultSubobjectUStaticMeshComponent(Mesh);SetRootComponent(Mesh);Sphere CreateDefaultSubobjectUSphereComponent(Sphere);Sphere-SetupAttachment(GetRootComponent());然后初始化中创建对象并将Mesh设置为根节点并将球碰撞体挂在Mesh下面。 UFUNCTION() virtual void OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult SweepResult);UFUNCTION() virtual void EndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);创建两个回调用于碰撞触发的开始和结束。 Sphere-OnComponentBeginOverlap.AddDynamic(this, AEffectActorBase::OnOverlap);Sphere-OnComponentEndOverlap.AddDynamic(this, AEffectActorBase::EndOverlap);绑定到球体碰撞事件上如果球体触发了碰撞则会调用这两个函数。 void AEffectActorBase::OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult SweepResult) {//TODO: 为了测试数值修改功能启用了常量转变量功能。if(IAbilitySystemInterface* ASCInterface CastIAbilitySystemInterface(OtherActor)){//根据类从ASC里面获取到对应的AS实例const UAttributeSetBase* AttributeSet CastUAttributeSetBase(ASCInterface-GetAbilitySystemComponent()-GetAttributeSet(UAttributeSetBase::StaticClass()));UAttributeSetBase* MutableAttributeSet const_castUAttributeSetBase*(AttributeSet); //将常量转为变量MutableAttributeSet-SetHealth(AttributeSet-GetHealth() 25.f);Destroy(); // 销毁自身} }接着在碰撞触发的时候从接口获取到AttributeSet然后设置数值增长。 接下来在UE里面创建一个蓝图基于EffectActorBase。 左侧会发现我们在代码中添加的Mesh和Sphere。 添加模型网格体然后调整球的大小。 运行场景输入showdebug abilitysystem 如果值修改那证明功能实现。 EffectActorBase.h // 版权归暮志未晚所有。#pragma once#include CoreMinimal.h #include GameFramework/Actor.h #include EffectActorBase.generated.hclass USphereComponent; class UStaticMeshComponent;UCLASS() class AURA_API AEffectActorBase : public AActor {GENERATED_BODY()public: AEffectActorBase();UFUNCTION()virtual void OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult SweepResult);UFUNCTION()virtual void EndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);protected:// 游戏开始或生成对象时回调virtual void BeginPlay() override;private:UPROPERTY(VisibleAnywhere)TObjectPtrUSphereComponent Sphere;UPROPERTY(VisibleAnywhere)TObjectPtrUStaticMeshComponent Mesh; }; EffectActorBase.app // 版权归暮志未晚所有。#include Actor/EffectActorBase.h#include AbilitySystemComponent.h #include AbilitySystemInterface.h #include AbilitySystem/AttributeSetBase.h #include Components/SphereComponent.hAEffectActorBase::AEffectActorBase() {// 设置当前对象是否每帧调用Tick()PrimaryActorTick.bCanEverTick false;Mesh CreateDefaultSubobjectUStaticMeshComponent(Mesh);SetRootComponent(Mesh);Sphere CreateDefaultSubobjectUSphereComponent(Sphere);Sphere-SetupAttachment(GetRootComponent()); }void AEffectActorBase::OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult SweepResult) {//TODO: 为了测试数值修改功能启用了常量转变量功能。if(IAbilitySystemInterface* ASCInterface CastIAbilitySystemInterface(OtherActor)){//根据类从ASC里面获取到对应的AS实例const UAttributeSetBase* AttributeSet CastUAttributeSetBase(ASCInterface-GetAbilitySystemComponent()-GetAttributeSet(UAttributeSetBase::StaticClass()));UAttributeSetBase* MutableAttributeSet const_castUAttributeSetBase*(AttributeSet); //将常量转为变量MutableAttributeSet-SetHealth(AttributeSet-GetHealth() 25.f);Destroy(); // 销毁自身} }void AEffectActorBase::EndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) { }void AEffectActorBase::BeginPlay() {Super::BeginPlay();Sphere-OnComponentBeginOverlap.AddDynamic(this, AEffectActorBase::OnOverlap);Sphere-OnComponentEndOverlap.AddDynamic(this, AEffectActorBase::EndOverlap); }
http://www.dnsts.com.cn/news/159084.html

相关文章:

  • 一般网站开发公司不用下载劰网站的片你懂的
  • 网站运营方案书法制建设网站
  • wordpress搭建个人网站费用营销网站科技
  • 做网站如何给图片命名wordpress 禁止索引目录
  • 跨境电商建站工具智库网站建设方案
  • 德州市市政工程建设总公司网站怎么用电脑做网站服务器
  • 深圳网站制作的公司排名win 7怎么建立wordpress
  • 建立一个个人介绍网站做电影网站如何赚钱
  • 做盗版网站 国外服务器吗wordpress调用内容前多少字
  • seo网站服务公司抖音seo排名优化
  • 中国移动网站建设怎么做广西网络电视
  • 17网站一起做网店怎么拿货天津seo外包平台
  • 做照片书哪个网站好wordpress调用内容前多少字
  • 42区 网站开发指南iis新建网站无法浏览
  • 镇江网站关键字优化做网站域名哪里来
  • 专业长沙做网站公司介休做网站
  • 响应式品牌网站设计网站制作备案上线流程
  • 网站筑云做关键词网站收录入口是什么
  • 网站地图做几个wordpress后台切换中文
  • 做旅游网站的意义网络营销有什么特点
  • 青岛高新区建设局网站在云服务器打建网站
  • 网站开发的业内人士亚马逊雨林探险作文
  • 湖南移动网站建设内江网站建设0832hdsj
  • 常平哪里有招计算机网站开发的巢湖路桥建设集团有限公司网站
  • 滨州的网站建设百度q3财报2022
  • 做网站的内容资源门户网站用什么程序做
  • 怎么样创建个人网站为什么 要建设网站
  • 建设俄语网站东莞大朗
  • app和网站开发区别个人建设网站流程图
  • app商城开发网站建设做网站动态效果心得