UE4自定义Pawn支持碰撞 横屏竖屏切换 单击双击 Android/iOS兼容

1.自定义碰撞组件

MyPawnMovementComponent.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/PawnMovementComponent.h"
#include "MyPawnMovementComponent.generated.h"

/**
 * 
 */
UCLASS()
class NPOWER_API UMyPawnMovementComponent : public UPawnMovementComponent
{
	GENERATED_BODY()

public:
	virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override;
	
};

MyPawnMovementComponent.cpp

// Fill out your copyright notice in the Description page of Project Settings.


#include "AR/Base/MyPawnMovementComponent.h"

void UMyPawnMovementComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

	// 确保所有内容仍然有效,并

猜你喜欢

转载自blog.csdn.net/tangfuling1991/article/details/126839379