初学UE5 C++②

目录

导入csv表格数据

创建、实例化、结构体

GameInstance

Actor

camera

绑定滚轮控制摇臂移动

碰撞绑定

角色碰撞设定 

按钮

UI显示 

单播代理

多播和动态多播

写一个接口

其他

 NewObject 和 CreateDefaultSubobject区别


导入csv表格数据

创建一个object的C++类

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "CharacterMsgObject.generated.h"USTRUCT(BlueprintType)
struct class CharacterMSG:public FTableRowBase {GENERATED_USTRUCT_BODY()UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="CharacterMsg")FString Name;UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="CharacterMsg")float Health;UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="CharacterMsg")int32 Level;
}
UCLASS()
class CPDD1_API UCharacterMsgObject : public UObject
{GENERATED_BODY()};

编译生成

做一个csv表格,对应结构体的元素

 拖拽csv到UE5中

导入时选中上述创建的结构体

创建、实例化、结构体

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "Engine/Classes/Engine/DataTable.h"
#include "UObject/NoExportTypes.h"
#include "CharacterMsgObject.generated.h"USTRUCT(BlueprintType)
struct FCharacterMSG :public FTableRowBase 
{GENERATED_USTRUCT_BODY()FCharacterMSG();//略UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CharacterMsg")FString Name;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CharacterMsg")float Health;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CharacterMsg")int32 Level;};
UCLASS()
class CPDD1_API UCharacterMsgObject : public UObject
{GENERATED_BODY()
public:FCharacterMSG CMSG;//供实体类调用
};
	//创建实例UCharacterMsgObject* MyTestMSGObject;
	MyTestMSGObject = NewObject<UCharacterMsgObject>(GetWorld(), UCharacterMsgObject::StaticClass());if (MyTestMSGObject) {UE_LOG(LogTemp, Warning, TEXT("MyObject is %s"), *MyTestMSGObject->GetName());UE_LOG(LogTemp, Warning, TEXT("NAME is %s"), *MyTestMSGObject->CMSG.Name);UE_LOG(LogTemp, Warning, TEXT("HEALTH is %f"), MyTestMSGObject->CMSG.Health);UE_LOG(LogTemp, Warning, TEXT("LEVEL is %d"), MyTestMSGObject->CMSG.Level);}

GameInstance

UMyGameInstance* MyGameInstance;MyGameInstance = Cast<UMyGameInstance>(GetWorld()->GetFirstPlayerController()->GetGameInstance());

应用游戏实例类 

Actor

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "Components/SceneComponent.h"
#include "Components/StaticMeshComponent.h"
#include "Components/BoxComponent.h"
#include "Particles/ParticleSystemComponent.h"
#include "Components/AudioComponent.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"UCLASS()
class CPDD1_API AMyActor : public AActor
{GENERATED_BODY()public:	// Sets default values for this actor's propertiesAMyActor();protected:// Called when the game starts or when spawnedvirtual void BeginPlay() override;public:	// Called every framevirtual void Tick(float DeltaTime) override;UPROPERTY(VisibleAnywhere,BlueprintReadWrite,Category="MySceneComponent")class USceneComponent* MyScene;UPROPERTY(VisibleAnywhere,BlueprintReadWrite,Category="MySceneComponent")class UStaticMeshComponent* MyMesh;UPROPERTY(VisibleAnywhere,BlueprintReadWrite,Category="MySceneComponent")class UParticleSystemComponent* MyParticle;UPROPERTY(VisibleAnywhere,BlueprintReadWrite,Category="MySceneComponent")class UBoxComponent* MyBox;UPROPERTY(VisibleAnywhere,BlueprintReadWrite,Category="MySceneComponent")class UAudioComponent* MyAudio;};
AMyActor::AMyActor()
{// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.PrimaryActorTick.bCanEverTick = true;MyScene = CreateDefaultSubobject<USceneComponent>(TEXT("MyCustomScene"));MyMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MyCustomScene"));MyParticle = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("MyCustomParticleSystem"));MyBox = CreateDefaultSubobject<UBoxComponent>(TEXT("MyCustomBox"));MyAudio = CreateDefaultSubobject<UAudioComponent>(TEXT("MyCustomAudio"));RootComponent = MyScene;MyMesh->SetupAttachment(MyScene);MyParticle->SetupAttachment(MyScene);MyBox->SetupAttachment(MyScene);MyAudio->SetupAttachment(MyBox);
}

静态加载类,要加   “_C”

camera

UPROPERTY(VisibleAnywhere,BlueprintReadOnly,Category="MySceneComponent")USceneComponent* MyRoot;
UPROPERTY(VisibleAnywhere,BlueprintReadOnly,Category="MySceneComponent")USpringArmComponent* MySpringArm;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "MySceneComponent")UCameraComponent* MyCamera;
 	// Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.PrimaryActorTick.bCanEverTick = true;MyRoot = CreateDefaultSubobject<USceneComponent>(TEXT("MyRoot"));MySpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("MySpringArm"));MyCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("MyCamera"));RootComponent = MyRoot;MySpringArm->SetupAttachment(MyRoot);MyCamera->SetupAttachment(MySpringArm);MySpringArm->bDoCollisionTest = false;

绑定滚轮控制摇臂移动

#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "SPlayerController.generated.h"/*** */
UCLASS()
class CPDD1_API ASPlayerController : public APlayerController
{GENERATED_BODY()
public:virtual void SetupInputComponent();void WheelUpFunction();void WheelDownFunction();
};

 绑定键在UE5输入中设置

因为这里的Pawn和Controller都设置为当前gamemode的角色,所有getPawn会锁到当前操控者的Pawn。

#include "SPlayerController.h"
#include "MyPawn.h"void ASPlayerController::SetupInputComponent()
{Super::SetupInputComponent();InputComponent->BindAction("WheelUp", IE_Pressed, this, &ASPlayerController::WheelUpFunction);InputComponent->BindAction("WheelDown", IE_Pressed, this, &ASPlayerController::WheelDownFunction);
}void ASPlayerController::WheelUpFunction()
{if (GetPawn()) {AMyPawn* pawn1= Cast<AMyPawn>(GetPawn());pawn1->Zoom(1,1);}
}void ASPlayerController::WheelDownFunction()
{if (GetPawn()) {AMyPawn* pawn1 = Cast<AMyPawn>(GetPawn());pawn1->Zoom(-1, 1);}
}
void AMyPawn::Zoom(float Direction, float Speed)
{float temp = MySpringArm->TargetArmLength - Direction * Speed * 10;if (temp > 2000.f || temp < 500.f)MySpringArm->TargetArmLength = temp;
}

 

碰撞绑定

	UPROPERTY(VisibleAnywhere,BlueprintReadWrite,Category="MySceneComponent")class UBoxComponent* MyBox;
	MyBox->OnComponentBeginOverlap.AddDynamic(this, &AMyActor::BeginOverlapFunction);MyBox->OnComponentEndOverlap.AddDynamic(this, &AMyActor::EndOverlapFunction);MyBox->OnComponentHit.AddDynamic(this, &AMyActor::OnComponentHitFunction);

绑定函数的参数从何而来?

 

-转到定义

再转到定义

找到同义的参数,看数字,如果是six,就把该函数后6位复制过来,绑定函数的参数括号内,去掉定义类型和变量名之间的逗号即可。

	UFUNCTION()void BeginOverlapFunction(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);UFUNCTION()void EndOverlapFunction(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);UFUNCTION()void OnComponentHitFunction(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);

角色碰撞设定 

	//碰撞设置MyBox->SetCollisionEnabled(ECollisionEnabled::NoCollision);MyBox->SetCollisionEnabled(ECollisionEnabled::QueryOnly);MyBox->SetCollisionEnabled(ECollisionEnabled::PhysicsOnly);MyBox->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);MyBox->SetCollisionEnabled(ECollisionEnabled::ProbeOnly);MyBox->SetCollisionEnabled(ECollisionEnabled::QueryAndProbe);//碰撞对象类型MyBox->SetCollisionObjectType(ECC_WorldDynamic);MyBox->SetCollisionObjectType(ECC_WorldStatic);MyBox->SetCollisionObjectType(ECC_Pawn);MyBox->SetCollisionObjectType(ECC_PhysicsBody);MyBox->SetCollisionObjectType(ECC_Vehicle);MyBox->SetCollisionObjectType(ECC_Destructible);//碰撞响应MyBox->SetCollisionResponseToAllChannels(ECR_Block);MyBox->SetCollisionResponseToAllChannels(ECR_Overlap);MyBox->SetCollisionResponseToAllChannels(ECR_Ignore);MyBox->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);//pawn允许重叠MyBox->SetCollisionResponseToChannel(ECC_WorldStatic,ECR_Block);//世界静态阻挡MyBox->SetCollisionResponseToChannel(ECC_WorldDynamic,ECR_Ignore);//世界动态忽略MyBox->SetBoxExtent(FVector(64, 64, 64));

按钮

绑定事件绑定函数时不用加括号

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "Components/Button.h"
#include "Blueprint/UserWidget.h"
#include "MyUserWidget.generated.h"UCLASS()
class CPDD1_API UMyUserWidget : public UUserWidget
{GENERATED_BODY()
public:UPROPERTY(meta=(BindWidget))//UI控件创建的按钮名称和声明名称相同UButton *ButtonStart;UPROPERTY(meta=(BindWidget))UButton* ButtonQuit;UFUNCTION()void Start();UFUNCTION()void Quit();virtual bool Initialize()override;//重写组件初始化函数UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="MyHealth")float CurrentHealth=100.f;UPROPERTY(EditAnywhere,BlueprintReadWrite,Category="MyHealth")float MaxHealth = 100.f;UFUNCTION()void UpdateHealth();
};
#include "MyUserWidget.h"bool UMyUserWidget::Initialize()
{if(!Super::Initialize())return false;ButtonStart->OnClicked.AddDynamic(this, &UMyUserWidget::Start);ButtonQuit->OnClicked.AddDynamic(this,&UMyUserWidget::Quit);return true;
}void UMyUserWidget::UpdateHealth()
{if (CurrentHealth <= 0) {GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("Death"));}else {CurrentHealth -= 30;}
}void UMyUserWidget::Start()
{GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("Start"));UpdateHealth();
}void UMyUserWidget::Quit()
{GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("Quit"));
}

UI显示 

在游戏模式的控制器脚本的开始运行函数中,

根据资源路径加载类,并创建该类的实例作为“提升为变量”的接盘。

void ASPlayerController::BeginPlay()
{Super::BeginPlay();UClass* widgetClass = LoadClass<UMyUserWidget>(NULL, TEXT("/Script/UMGEditor.WidgetBlueprint'/Game/HbtScripts/MyUserWidget233.MyUserWidget233_C'"));UMyUserWidget* MyWidget = nullptr;MyWidget = CreateWidget<UMyUserWidget>(GetWorld(), widgetClass);MyWidget->AddToViewport();
}

单播代理

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyDelegateActor.generated.h"DECLARE_DELEGATE(NoParamDelegate);//1.声明代理类型
DECLARE_DELEGATE_OneParam(OneParamDelegate,FString);
DECLARE_DELEGATE_TwoParams(TwoParamDelegate, FString, int32);
DECLARE_DELEGATE_ThreeParams(ThreeParamDelegate, FString, int32, float);
DECLARE_DELEGATE_RetVal(FString, RetvalDelegate);UCLASS()
class CPDD1_API AMyDelegateActor : public AActor
{GENERATED_BODY()public:	// Sets default values for this actor's propertiesAMyDelegateActor();protected:// Called when the game starts or when spawnedvirtual void BeginPlay() override;public:	// Called every framevirtual void Tick(float DeltaTime) override;//2.声明代理名称NoParamDelegate NoParamDelegate;OneParamDelegate OneParamDelegate;TwoParamDelegate TwoParamDelegate;ThreeParamDelegate ThreeParamDelegate;RetvalDelegate RetvalDelegate;//声明代理函数void NoParamFunction();void OneParamFunction(FString str);void TwoParamFunction(FString str,int32 value);void ThreeParamFunction(FString str,int32 value,float balue1);FString RetvalFunction();};

 

// Fill out your copyright notice in the Description page of Project Settings.#include "MyDelegateActor.h"// Sets default values
AMyDelegateActor::AMyDelegateActor()
{// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.PrimaryActorTick.bCanEverTick = true;//3.绑定代理方法NoParamDelegate.BindUObject(this, &AMyDelegateActor::NoParamFunction);OneParamDelegate.BindUObject(this, &AMyDelegateActor::OneParamFunction);TwoParamDelegate.BindUObject(this, &AMyDelegateActor::TwoParamFunction);ThreeParamDelegate.BindUObject(this, &AMyDelegateActor::ThreeParamFunction);RetvalDelegate.BindUObject(this, &AMyDelegateActor::RetvalFunction);}// Called when the game starts or when spawned
void AMyDelegateActor::BeginPlay()
{Super::BeginPlay();//4.调用代理NoParamDelegate.ExecuteIfBound();OneParamDelegate.ExecuteIfBound("OneParamDelegate");TwoParamDelegate.ExecuteIfBound("TwoParamDelegate",648);ThreeParamDelegate.ExecuteIfBound("ThreeParamDelegate",648,3.6f);FString strvalue= RetvalDelegate.Execute();
}// Called every frame
void AMyDelegateActor::Tick(float DeltaTime)
{Super::Tick(DeltaTime);}void AMyDelegateActor::NoParamFunction()
{GEngine->AddOnScreenDebugMessage(-1,5.0f,FColor::Blue,TEXT("NoParamDelegate"));
}void AMyDelegateActor::OneParamFunction(FString str)
{GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString::Printf(TEXT("%s"),*str));
}void AMyDelegateActor::TwoParamFunction(FString str, int32 value)
{GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString::Printf(TEXT("%s,%d"), *str,value));
}void AMyDelegateActor::ThreeParamFunction(FString str, int32 value, float value1)
{GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, FString::Printf(TEXT("%s,%d,%f"), *str, value, value1));
}FString AMyDelegateActor::RetvalFunction()
{FString str = FString::Printf(TEXT("RetvalFunction"));return str;
}

多播和动态多播

声明类型


DECLARE_MULTICAST_DELEGATE_OneParam(OneParamMultiDelegate, FString);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDynamicMutilDelegate,FString,param);

声明名称

	//多播代理OneParamMultiDelegate OneParamMultiDelegate;//动态多播UPROPERTY(BlueprintAssignable)FDynamicMutilDelegate FDynamicMutilDelegate;

 绑定方法

	//多播代理绑定OneParamMultiDelegate.AddUObject(this, &AMyDelegateActor::MultiDelegateFunction1);

执行(参数根据自己定义的类型) 

	//执行多播代理OneParamMultiDelegate.Broadcast("OneParamMultiDelegate");//执行动态多播代理FDynamicMutilDelegate.Broadcast("FDynamicMutilDelegate");

多播代理能同时调用多个函数,区别是动态多播能暴露给蓝图。

多播在脚本中写好绑定的多播函数。

动态多播在此基础上,能在蓝图上额外绑定事件,不止函数。

写一个接口

用I开头那个

声明要重写函数时,有{}

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "TestInterface.generated.h"// This class does not need to be modified.
UINTERFACE(MinimalAPI)
class UTestInterface : public UInterface
{GENERATED_BODY()
};/*** */
class CPDD1_API ITestInterface
{GENERATED_BODY()// Add interface functions to this class. This is the class that will be inherited to implement this interface.
public:virtual void Attack() {};virtual void CaclulateHealth() {};
};

 调用,接屁股+头文件

重写

	virtual void Attack() override;virtual void CaclulateHealth() override;

 然后再cpp编写即可。

其他

在使用打印语句时报错什么断点问题点,尝试在打印语句上加UFUNCTION

GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("Death"));

变量要编辑,组件要可视,然后均为蓝图读写

 NewObject 和 CreateDefaultSubobject区别

NewObject 和 CreateDefaultSubobject 是 Unreal Engine 中用于创建对象的两种不同方式,它们有以下区别:

  1. 对象类型:NewObject 可以用于创建任何类型的对象,包括 UObject、AActor、APawn 等。而 CreateDefaultSubobject 仅适用于在一个类的构造函数或初始化过程中创建默认的子对象。

  2. 对象生命周期:使用 NewObject 创建的对象是动态分配的,并由开发人员负责管理其生命周期。而使用 CreateDefaultSubobject 创建的对象是由 Unreal Engine 的对象系统自动管理的,它们的生命周期与宿主对象的生命周期相同。

  3. 对象属性:CreateDefaultSubobject 创建的对象会自动继承宿主对象的属性设置,例如编辑器中设置的默认值、蓝图可编辑性等。而使用 NewObject 创建的对象需要手动设置属性。

  4. 宿主对象关系:CreateDefaultSubobject 创建的子对象与宿主对象之间建立了父子关系,这意味着子对象的生命周期与宿主对象紧密相关,并且在宿主对象销毁时,子对象也会被销毁。而 NewObject 创建的对象没有默认的宿主对象关系。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/151405.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

设计模式-责任链-笔记

动机&#xff08;Motivation&#xff09; 在软件构建过程中&#xff0c;一个请求可能被多个对象处理&#xff0c;但是每个请求在运行时只能有个接受者&#xff0c;如果显示指定&#xff0c;将必不可少地带来请求者与接受者的紧耦合。 如何使请求的发送者不需要指定具体的接受…

视频剪辑方法:一键批量调整色调的高效技巧

在视频剪辑的过程中&#xff0c;色调调整是一项非常重要的工作。它能够改变影片的氛围、情感和视觉效果&#xff0c;更好地沉浸在影片的情境中。然而&#xff0c;对于许多视频剪辑师来说&#xff0c;批量调整色调是一项非常繁琐的任务&#xff0c;需要耗费大量的时间和精力。色…

Docker Desktop 配置阿里云镜像加速

阿里云搜索镜像&#xff0c;打开容器镜像服务&#xff0c;复制镜像加速器地址 Docker Desktop 右上角设置&#xff0c;选择 Docker Engine&#xff0c;在配置中添加阿里云的镜像地址&#xff0c;右下 Apply & restart 即可。 "registry-mirrors": ["https…

vmware workstation pro 17.5 安装 macos 13.5.2 虚拟机超详细图文教程

前言 本文很细&#xff0c;甚至有点墨迹&#xff0c;主要为了方便从来没用过 vmware 的新人&#xff0c;其实大部分步骤和正常安装虚拟机没有区别&#xff0c;详细贴图以方便大家对比细节 参考文章 感谢大佬们的无私分享 https://blog.csdn.net/qq_19731521/article/details…

idea中误删.iml和.idea文件,如何处理

目录 一、问题描述 二、解决方案 1、理论知识 &#xff08;1&#xff09;.iml 文件 &#xff08;2&#xff09;.idea文件 2、操作环境 3、操作步骤 &#xff08;1&#xff09;找到【Maven】工具按钮 &#xff08;2&#xff09;点图标&#xff0c;重复导入maven项目&am…

大批量合并识别成一个表或文档的方法

金鸣表格文字识别系统功能强大&#xff0c;其中可以将上百张图片或上百页PDF中的表格文字合并识别成一个表格或文档的功能尤其受到广大用户的欢迎&#xff0c;那应该怎么操作呢&#xff1f; 一、打开金鸣表格文字识别软件&#xff0c;点击左上角的“表格识别”&#xff0c;选择…

多因素方差分析(Multi-way Analysis of Variance) R实现

1, data0507 flower 是某种植物在两个海拔和两个气温下的开花高度&#xff0c;采用合适 的统计方法&#xff0c;检验该种植物的开花高度在不同的海拔之间和不同的气温之间有无差异&#xff1f;如果有差异&#xff0c;具体如何差异的&#xff1f;&#xff08;说明依据、结论等关…

Codeforces Round 908 (Div. 2)

一个教训&#xff1a;做题的时候一定要自己模拟一遍所有样例&#xff0c;这样思路出来的很快&#xff01;&#xff01;&#xff01; C. Anonymous Informant Example input Copy 6 5 3 4 3 3 2 3 3 100 7 2 1 5 5 6 1 1 1 1 1 1000000000 1 8 48 9 10 11 12 13 14 …

【springboot笔记】程序可用性检测ApplicationAvailability

1.背景 springboot-3.1.5 ApplicationAvailability LivenessState ReadinessState AvailabilityChangeEvent 我们可以通过ApplicationAvailability获取当前应用程序的可用性&#xff0c;这个可用性包括ApplicationContext和对外请求路由两种。 LivenessState 是表示Applicatio…

打开文件 和 文件系统的文件产生关联

补充1&#xff1a;硬件级别磁盘和内存之间数据交互的基本单位 OS的内存管理 内存的本质是对数据临时存/取&#xff0c;把内存看成很大的缓冲区 物理内存和磁盘交互的单位是4KB&#xff0c;磁盘中未被打开的文件数据块也是4KB&#xff0c;所以磁盘中页帧也是4KB&#xff0c;内存…

吴恩达《机器学习》8-7:多元分类

在机器学习领域&#xff0c;经常会遇到不止两个类别的分类问题。这时&#xff0c;需要使用多类分类技术。本文将深入探讨多类分类&#xff0c;并结合学习内容中的示例&#xff0c;了解神经网络在解决这类问题时的应用。 一、理解多类分类 多类分类问题是指当目标有多个类别时…

Vue3 常用组件

一、Fragment组件 Vue2 的template 模板中必须要有一个根标签&#xff0c;而我们在Vue3 的模板中不需要使用根标签就能渲染&#xff0c;因为Vue3 在内部会将多个标签包含在一个Fragment 虚拟元素中。 好处就在于可以减少标签的层级&#xff0c;减小内存占用。 二、Teleport组…

使用cli批量下载GitHub仓库中所有的release

文章目录 1\. 引言2\. 工具官网3\. 官方教程4\. 测试用的网址5\. 安装5.1. 使用winget安装5.2. 查看gh是否安装成功了 6\. 使用6.1. 进行GitHub授权6.1.1. 授权6.1.2. 授权成功6.2 查看指定仓库中的所有版本的release6.2.1. 默认的30个版本6.2.2. 自定义的100个版本6.3 下载特定…

springboot实现在线人数统计

在线人数统计 笔者做了一个网站&#xff0c;需要统计在线人数。 在线有两种&#xff1a; 一、如果是后台系统如果登录算在线&#xff0c;退出的时候或者cookie、token失效的时候就算下线 二、如果是网站前台&#xff0c;访问的时候就算在线 今天我们来讲一下第2种情况&…

大数据HCIE成神之路之数学(3)——概率论

概率论 1.1 概率论内容介绍1.1.1 概率论介绍1.1.2 实验介绍 1.2 概率论内容实现1.2.1 均值实现1.2.2 方差实现1.2.3 标准差实现1.2.4 协方差实现1.2.5 相关系数1.2.6 二项分布实现1.2.7 泊松分布实现1.2.8 正态分布1.2.9 指数分布1.2.10 中心极限定理的验证 1.1 概率论内容介绍…

PostgreSQL基于Citus实现的分布式集群

&#x1f4e2;&#x1f4e2;&#x1f4e2;&#x1f4e3;&#x1f4e3;&#x1f4e3; 哈喽&#xff01;大家好&#xff0c;我是【IT邦德】&#xff0c;江湖人称jeames007&#xff0c;10余年DBA及大数据工作经验 一位上进心十足的【大数据领域博主】&#xff01;&#x1f61c;&am…

MongoDB相关基础操作(库、集合、文档)

文章目录 一、库的相关操作1、查看数据库2、查看当前库3、创建数据库4、删除数据库 二、集合的相关操作1、查看库中所有集合2、创建集合2.1、显示创建2.2、隐式创建 3、删除集合 三、文档的相关操作1、插入文档1.1、插入单条文档1.2、插入多条文档1.3、脚本方式 2、查询文档3、…

python 就是随便玩玩,生成gif图,生成汉字图片,超级简单

文章目录 主方法调用LetterDrawingWordDoingImage 上图 你也想玩的话&#xff0c;可以直接上码云去看 码云链接 主方法调用 import analysisdata.WordDoingImage as WordDoingImage import analysisdata.LetterDrawing as LetterDrawingif __name__ __main__:# 输入的文本&a…

预约按摩小程序功能及使用指南;

小程序预约按摩功能及使用指南&#xff1a; 1. 注册登录&#xff1a;用户可选择通过账号密码或微信一键登录&#xff0c;便捷注册&#xff0c;轻松管理预约服务。 2. 查找店铺&#xff1a;展示附近的按摩店铺信息&#xff0c;用户可根据需求选择合适的店铺进行预约。 3. 选择服…

【运维篇】5.4 Redis 并发延迟检测

文章目录 0.前言Redis工作原理可能引起并发延迟的常见操作和命令并发延迟检测分析和解读监控数据&#xff1a;优化并发延迟的策略 1. 检查CPU情况2. 检查网络情况3. 检查系统情况4. 检查连接数5. 检查持久化 &#xff1a;6. 检查命令执行情况 0.前言 Redis 6.0版本之前其使用单…