예제 #1
0
ASimModeWorldMultiRotor::ASimModeWorldMultiRotor()
{
    static ConstructorHelpers::FClassFinder<APIPCamera> external_camera_class(TEXT("Blueprint'/AirSim/Blueprints/BP_PIPCamera'"));
    external_camera_class_ = external_camera_class.Succeeded() ? external_camera_class.Class : nullptr;
    static ConstructorHelpers::FClassFinder<ACameraDirector> camera_director_class(TEXT("Blueprint'/AirSim/Blueprints/BP_CameraDirector'"));
    camera_director_class_ = camera_director_class.Succeeded() ? camera_director_class.Class : nullptr;
    static ConstructorHelpers::FClassFinder<TMultiRotorPawn> vehicle_pawn_class(TEXT("Blueprint'/AirSim/Blueprints/BP_FlyingPawn'"));
    vehicle_pawn_class_ = vehicle_pawn_class.Succeeded() ? vehicle_pawn_class.Class : nullptr;
}
예제 #2
0
ABossSpawnpoint::ABossSpawnpoint() {
	static ConstructorHelpers::FClassFinder<ABoss> BossClass(TEXT("/Game/TopDown/Blueprints/Bosses/Boss"));
	if (BossClass.Succeeded()) {
		bossClass = BossClass.Class;
	}
	else {
		bossClass = ABoss::StaticClass();
	}

	static ConstructorHelpers::FClassFinder<ABossMechanic> MechanicClass(TEXT("/Game/TopDown/Blueprints/Bosses/Boss_Mehanics/Boss_Damage_Boost"));
	if (MechanicClass.Succeeded()) {
		mechanicClass = MechanicClass.Class;
	}
	else {
		mechanicClass = ADamageBoostMechanic::StaticClass();
	}
}
void AIWeapon::SetAssets(const FString& SkeletMeshPath, const FString& ProjectileBPPath, const FString& ParticleSystemPath)
{
	static ConstructorHelpers::FObjectFinder<USkeletalMesh> SkeletalAsset(*SkeletMeshPath);
	if (SkeletalAsset.Succeeded())
	{
		WeaponSkeletalMeshComp->SetSkeletalMesh(SkeletalAsset.Object);
	}

	static ConstructorHelpers::FClassFinder<AActor> ProjectileBlueprint(*ProjectileBPPath);
	if (ProjectileBlueprint.Succeeded())
	{
		ProjectileClass = ProjectileBlueprint.Class;
	}

	static ConstructorHelpers::FObjectFinder<UParticleSystem> FlashAsset(*ParticleSystemPath);
	if (FlashAsset.Succeeded())
	{
		FlashParticleSystemRaw = FlashAsset.Object;
	}
}
예제 #4
0
AMech_RPGCharacter::AMech_RPGCharacter() :
	healthChangeModifier(1),
	inventory(NewObject<UInventory>(UInventory::StaticClass())),
	defenceModifier(0),
	speedModifier(1),
	startingRole(GroupEnums::DPS),
	health(2000),
	maxHealth(2000),
	channeling(false),
	team(TeamEnums::Paladins)
{
	static int32 ID = 0;
	SetID(ID++);
	SetActorTickEnabled(true);
	AIControllerClass = ABaseAIController::StaticClass();

	// Create a camera boom...
	CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom"));
	CameraBoom->AttachToComponent(RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false));
	CameraBoom->bAbsoluteRotation = true; // Don't want arm to rotate when character does
	CameraBoom->TargetArmLength = 1800.0f;
	CameraBoom->RelativeRotation = FRotator(-85.f, 0.f, 0.f);
	CameraBoom->bDoCollisionTest = false; // Don't want to pull camera in when it collides with level

	// Create a camera...
	TopDownCameraComponent = CreateDefaultSubobject<UCameraComponent>(TEXT("TopDownCamera"));
	TopDownCameraComponent->AttachToComponent(CameraBoom, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false), USpringArmComponent::SocketName);
	TopDownCameraComponent->bUsePawnControlRotation = false; // Camera does not rotate relative to arm

	// Don't rotate character to camera direction
	bUseControllerRotationPitch = false;
	bUseControllerRotationYaw = false;
	bUseControllerRotationRoll = false;

	// Configure character movement
	GetCharacterMovement()->bOrientRotationToMovement = true; // Rotate character to moving direction
	GetCharacterMovement()->RotationRate = FRotator(0.f, 640.f, 0.f);
	GetCharacterMovement()->bConstrainToPlane = true;
	GetCharacterMovement()->bSnapToPlaneAtStart = true;
	GetCharacterMovement()->bCanWalkOffLedges = false;
	GetCharacterMovement()->SetWalkableFloorAngle(90);
	GetCharacterMovement()->SetAvoidanceGroup(0);
	GetCharacterMovement()->SetGroupsToAvoid(0);
	//GetCharacterMovement()->SetGroupsToIgnore(0);

	speed = GetCharacterMovement()->MaxWalkSpeed;

	static ConstructorHelpers::FClassFinder<UFloatingStats_BP> statsWidget(TEXT("/Game/TopDown/Blueprints/UI/CharacterUI/FloatingStats"));

	if (statsWidget.Succeeded()) {
		widgetClass = statsWidget.Class;
		stats = CreateDefaultSubobject<UWidgetComponent>(TEXT("Floating Stats Component"));
		stats->AttachToComponent(GetRootComponent(), FAttachmentTransformRules(EAttachmentRule::KeepRelative, false));
	}

	static ConstructorHelpers::FClassFinder<UFloatingTextUI> floatingTextWidget(TEXT("/Game/TopDown/Blueprints/UI/CharacterUI/Floating_Text"));

	if (floatingTextWidget.Succeeded()) {
		floatingTextClass = floatingTextWidget.Class;
	}

	static ConstructorHelpers::FObjectFinder<USkeletalMesh> newMesh(TEXT("/Game/TopDown/Meshes/Mech/Mech.Mech"));

	if (newMesh.Succeeded()) {
		GetMesh()->SetSkeletalMesh(newMesh.Object);
		GetMesh()->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
		GetMesh()->SetCollisionObjectType(mCharacterCollision);
	}

	// Set size for player capsule
	GetCapsuleComponent()->InitCapsuleSize(60.0f, 140.0f);
	GetCapsuleComponent()->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
	GetCapsuleComponent()->SetCollisionObjectType(mCharacterCollision);
	GetCapsuleComponent()->SetCollisionResponseToChannel(mItemCollision, ECollisionResponse::ECR_Ignore);
	//GetCapsuleComponent()->SetCollisionResponseToChannel(mCharacterCollision, ECollisionResponse::ECR_Ignore);

	//radiusDection = CreateDefaultSubobject<USphereComponent>(TEXT("RootComponent"));
	//radiusDection->InitSphereRadius(1500.0f);
	//radiusDection->SetCollisionProfileName(TEXT("Pawn"));
	//radiusDection->AttachTo(this->RootComponent);
	//radiusDection->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
	characters.Add(this);
}