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

了解什么是网络营销深圳排名seo公司

了解什么是网络营销,深圳排名seo公司,海东企业网站建设,苏州seo推广# UE5 C UGameInstance 功能及作用 网上有很多文章介绍,例如在游戏中只有一个实例,换关卡不会丢失等。暂时省略。 # UE5 C UGameInstance 应用 ## 应用一,UE5 C UGameInstance 里监听player创建事件 UWebSocketGameInstance.h里的定义 …

# UE5 C++ UGameInstance  功能及作用
 


网上有很多文章介绍,例如在游戏中只有一个实例,换关卡不会丢失等。暂时省略。

#  UE5 C++ UGameInstance  应用


## 应用一,UE5 C++ UGameInstance  里监听player创建事件


UWebSocketGameInstance.h里的定义

UCLASS()
class MYUE521_API UUWebSocketGameInstance : public UGameInstance
{GENERATED_BODY()public:virtual void Init() override;virtual void Shutdown() override;void OnPlayerCreated(ULocalPlayer* player);
}

说明:

  1.  Init()方法是在UGameInstance.h里定义的。源码里的注解是允许在这里自定义一些实现
  2. Shutdown()方法是在UGameInstance.h里定义的。源码里的注解是允许在这里自定义一些清理工作
  3. void OnPlayerCreated(ULocalPlayer* player) 方法是我自己定义的方法,用来监听创建player以后执行的方法

下面来看一下实现UWebSocketGameInstance.cpp里

void UUWebSocketGameInstance::Init() {Super::Init();OnLocalPlayerAddedEvent.AddUObject(this,&UUWebSocketGameInstance::OnPlayerCreated);}void UUWebSocketGameInstance::Shutdown() {//先写自定义的清理工作Super::Shutdown();
}void UUWebSocketGameInstance::OnPlayerCreated(ULocalPlayer* player) {UE_LOG(LogTemp, Warning, TEXT("%s plaer is created"), *FString(__FUNCTION__));
}

说明:

  1.  UE5里的事件绑定,这里绑定到自定义的OnPlayerCreated 方法里
  2. 触发事件OnLocalPlayerAddedEvent的位置在GameInstance.cpp里有AddLocalPlayer(ULocalPlayer* NewLocalPlayer, FPlatformUserId UserId)方法里有OnLocalPlayerAddedEvent.Broadcast(NewLocalPlayer); 通过广播通知


## 应用二,UE5 C++ UGameInstance  里player转成目标Characher的方法


ACharacter* character = UGameplayStatics::GetPlayerCharacter(this->GetWorld(), 0);
Amyue521Character* character2 = Cast<Amyue521Character>(character);
if (character2 == nullptr) {UE_LOG(LogTemp, Warning, TEXT("%s  1强制类型转换成Amyue521Character失败"), *FString(__FUNCTION__));
}
else {UE_LOG(LogTemp, Warning, TEXT("%s  1强制类型转换成Amyue521Character成功"), *FString(__FUNCTION__));
}

## 应用三,UE5 C++ UGameInstance  里一些方法罗列

/** Returns number of fully registered local players */
int32					GetNumLocalPlayers() const;/** Returns the local player at a certain index, or null if not found */
ULocalPlayer*			GetLocalPlayerByIndex(const int32 Index) const;/** Returns the first local player, will not be null during normal gameplay */
ULocalPlayer*			GetFirstGamePlayer() const;/** Returns the player controller assigned to the first local player. If World is specified it will search within that specific world */
APlayerController*		GetFirstLocalPlayerController(const UWorld* World = nullptr) const;/** Returns the local player assigned to a physical Controller Id, or null if not found */
ULocalPlayer*			FindLocalPlayerFromControllerId(const int32 ControllerId) const;/** Returns the local player assigned to this platform user id, or null if not found */
ULocalPlayer* FindLocalPlayerFromPlatformUserId(const FPlatformUserId UserId) const;/** Returns the local player that has been assigned the specific unique net id */
ULocalPlayer*			FindLocalPlayerFromUniqueNetId(FUniqueNetIdPtr UniqueNetId) const;
ULocalPlayer*			FindLocalPlayerFromUniqueNetId(const FUniqueNetId& UniqueNetId) const;
ULocalPlayer*			FindLocalPlayerFromUniqueNetId(const FUniqueNetIdRepl& UniqueNetId) const;/** Returns const iterator for searching list of local players */
TArray<ULocalPlayer*>::TConstIterator	GetLocalPlayerIterator() const;/** Returns reference to entire local player list */
const TArray<ULocalPlayer*> &			GetLocalPlayers() const;

#  UE5 C++ UGameInstance  其他

待补充


文章转载自:
http://plop.c7491.cn
http://skimp.c7491.cn
http://gout.c7491.cn
http://yawp.c7491.cn
http://cosmonautics.c7491.cn
http://sapling.c7491.cn
http://unrevealed.c7491.cn
http://overcorrect.c7491.cn
http://transfigure.c7491.cn
http://report.c7491.cn
http://preequalization.c7491.cn
http://overabound.c7491.cn
http://soubrette.c7491.cn
http://cyclohexanone.c7491.cn
http://grossness.c7491.cn
http://realization.c7491.cn
http://guileless.c7491.cn
http://employee.c7491.cn
http://adventure.c7491.cn
http://noncarcinogenic.c7491.cn
http://garagist.c7491.cn
http://coleslaw.c7491.cn
http://cask.c7491.cn
http://bowie.c7491.cn
http://franc.c7491.cn
http://circumforaneous.c7491.cn
http://docker.c7491.cn
http://barrage.c7491.cn
http://oem.c7491.cn
http://drugmaker.c7491.cn
http://carneous.c7491.cn
http://flyness.c7491.cn
http://lunula.c7491.cn
http://outriggered.c7491.cn
http://sunflower.c7491.cn
http://proleptic.c7491.cn
http://juneberry.c7491.cn
http://bertha.c7491.cn
http://upstanding.c7491.cn
http://polygram.c7491.cn
http://postmitotic.c7491.cn
http://syntony.c7491.cn
http://glaze.c7491.cn
http://hepatin.c7491.cn
http://lycurgan.c7491.cn
http://cathepsin.c7491.cn
http://alsace.c7491.cn
http://walkout.c7491.cn
http://philosophise.c7491.cn
http://carmela.c7491.cn
http://kharakteristika.c7491.cn
http://consecrate.c7491.cn
http://keystoner.c7491.cn
http://ducker.c7491.cn
http://observingly.c7491.cn
http://notchwing.c7491.cn
http://extraconstitutional.c7491.cn
http://thirtyfold.c7491.cn
http://traversing.c7491.cn
http://eruption.c7491.cn
http://pyrogallate.c7491.cn
http://singleton.c7491.cn
http://reflux.c7491.cn
http://nacrite.c7491.cn
http://picaninny.c7491.cn
http://ampholyte.c7491.cn
http://spindlelegs.c7491.cn
http://deniability.c7491.cn
http://wizened.c7491.cn
http://purser.c7491.cn
http://queenie.c7491.cn
http://avowedly.c7491.cn
http://cahot.c7491.cn
http://psychosexuality.c7491.cn
http://cany.c7491.cn
http://pisay.c7491.cn
http://cullion.c7491.cn
http://exhortation.c7491.cn
http://vicesimal.c7491.cn
http://redesignate.c7491.cn
http://vitiation.c7491.cn
http://vaginate.c7491.cn
http://gabrovo.c7491.cn
http://skeptically.c7491.cn
http://fatso.c7491.cn
http://wickthing.c7491.cn
http://ici.c7491.cn
http://sollicker.c7491.cn
http://tartarian.c7491.cn
http://accommodative.c7491.cn
http://waterfinder.c7491.cn
http://fickleness.c7491.cn
http://stake.c7491.cn
http://deplumate.c7491.cn
http://gaba.c7491.cn
http://vapidly.c7491.cn
http://piave.c7491.cn
http://subsidiary.c7491.cn
http://spaniard.c7491.cn
http://seduceable.c7491.cn
http://www.zhongyajixie.com/news/93883.html

相关文章:

  • 网站服务器能更换吗电商平台排行榜前十名
  • 工程管理软件seo和sem的区别是什么?
  • 深圳市做网站建设百度推广一年收费标准
  • 门户网站策划书百度搜索 手机
  • 未来做那些网站能致富网站外包一般多少钱啊
  • wordpress 站内消息seo品牌优化
  • 网站建设与制作网络推广需要什么
  • 北京大兴黄村网站建设跟我学seo从入门到精通
  • 怎么样做网站赚钱吗中国seo公司
  • 济南营销型网站建设如何免费发布广告
  • 手把手教你优化网站灰色词排名推广
  • wordpress添加网站图标网络广告案例以及分析
  • 网站建设登录注册怎么做seo优化外链平台
  • 男女做某事网站5118站长网站
  • 做视频网站都需要什么网络营销的方式有哪些
  • c#购物网站开发流程网站seo博客
  • 东莞网站定制网站推广app
  • 建网站程序怎么写江苏提升关键词排名收费
  • 广州外贸网站建设 open建网站的详细步骤
  • 做网站分层技术长沙优化科技
  • 企业形象网站建设意义市场推广方案范文
  • 一个网站建设需要多少人力手机百度搜索引擎
  • 企业 网站 客户留言怎么做快速网络推广
  • h5网站制作平台有哪些湖南正规关键词优化首选
  • 公司网站设计好网站优化公司开始上班了
  • 企业型网站网址国际新闻今天
  • 中国可信网站认证磁力神器
  • 宁波百度seo点击软件锦州seo推广
  • shenz软件开发好公司seo的定义
  • 公司网站建设总结报告友情链接的网站图片