这篇教程C++ GetActorLocation函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetActorLocation函数的典型用法代码示例。如果您正苦于以下问题:C++ GetActorLocation函数的具体用法?C++ GetActorLocation怎么用?C++ GetActorLocation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetActorLocation函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetWorldvoid ASpawnerTrigger::spawn(){ if(whatToSpawn!=NULL){ UWorld* world = GetWorld(); if (world) { FActorSpawnParameters params; params.Owner = this; params.bNoCollisionFail = true; FVector loc = GetActorLocation()+offset; FRotator rotation = FRotator::ZeroRotator; rotation.Yaw = 90.f; AActor *a = world->SpawnActor<AActor>(whatToSpawn, loc, rotation, params); ++nbSpawned; if( nbSpawned < numToSpawn){ FTimerHandle timerHandler; GetWorldTimerManager().SetTimer(timerHandler, this, &ASpawnerTrigger::spawn, timeBetweenSpawn, false); } } if(bDestroyWhenFinished && nbSpawned >= numToSpawn){ Destroy(); } }}
开发者ID:yongaro,项目名称:Borderlands,代码行数:20,
示例2: GetWorldvoid AWeapon::FireFunction(){ if (firedObject){ UWorld* world = GetWorld(); if (world){ FActorSpawnParameters parameters = FActorSpawnParameters(); parameters.bNoCollisionFail = true; parameters.Instigator = Owner; parameters.Name = GetProjectileName(); FVector spawnLocation = GetActorLocation(); FRotator spawnRotation = GetActorRotation(); AActor* Spawned = world->SpawnActor(*firedObject, &spawnLocation, &spawnRotation,parameters); AFirable* firable = Cast<AFirable>(Spawned); firable->SetColor(ProjectileColor); firable->Instigator = Owner->GetController(); firable->Damage = damage; firable->OwnerID = OwnerShipNumber; } }}
开发者ID:AlexZhangji,项目名称:ShootingStar,代码行数:20,
示例3: GetActorLocationTArray<RobotDataTypes::PlayerLocation>* ARobot::getVisiblePlayers(){ FVector ownLocation = GetActorLocation(); FRotator ownRotation = GetActorRotation(); TArray<RobotDataTypes::PlayerLocation>* visiblePlayerLocations = new TArray<RobotDataTypes::PlayerLocation>(); //Iterate through all Robots for (TActorIterator<ARobot> ActorItr(GetWorld()); ActorItr; ++ActorItr) { ARobot* robot = Cast<ARobot>(*ActorItr); if (this == robot) continue; if (isObjectVisible(robot->getPosition())) { visiblePlayerLocations->Add(RobotDataTypes::PlayerLocation{ robot->getTeamId(), robot->getPlayerId(), new FVector(robot->getPosition()) }); } } return visiblePlayerLocations;}
开发者ID:RocketRider,项目名称:UnrealCup,代码行数:20,
示例4: GetActorLocationvoid APlayerOvi::AjustPosition() { FVector location = GetActorLocation(); if (location.X > m_limit) location.X = m_limit; else if (location.X < -m_limit) location.X = -m_limit; if (location.Y > m_limit) location.Y = m_limit; else if (location.Y < -m_limit) location.Y = -m_limit; if (location.Z > m_limit) location.Z = m_limit; else if (location.Z < -m_limit) location.Z = -m_limit; SetActorLocation(location);}
开发者ID:alfreSosa,项目名称:TowardTheLight,代码行数:20,
示例5: AttachDriver_Implementationvoid AUTWeaponPawn::AttachDriver_Implementation(APawn* P){ AUTCharacter* Char = Cast<AUTCharacter>(P); if (Char != NULL) { // UTP.SetWeaponAttachmentVisibility(false); // TODO: FIXME: Weapon attachement visibility // TODO: PR for SetWeaponAttachmentVisibility if (MyVehicle->bAttachDriver) { // UC: UTP.SetCollision(false, false); // UC: UTP.bCollideWorld = false; Char->SetActorEnableCollision(false); //UTP.SetHardAttach(true); // TODO: FIXME: add hard attach Char->SetActorLocation(GetActorLocation()); //UTP.SetPhysics(PHYS_None); // TODO: FIXME: Set Physics state MyVehicle->SitDriver(Char, MySeatIndex); } }}
开发者ID:UTCommunity,项目名称:UTVehicles,代码行数:21,
示例6: GetActorLocation/** Update the modifier */void AFluidSurfaceOscillator::Update( float DeltaTime ){ if( !FluidActor ) return; OscTime += DeltaTime; // If frequency is zero - just set velocity to strength float Period, Amp, CurrPhase; if( Frequency > 0.0001f ) { Period = 1.f / Frequency; CurrPhase = ( FMath::Fmod( OscTime, Period ) * Frequency ) + (float) Phase / 255.f; Amp = Strength * FMath::Sin( CurrPhase * PI * 2 ); } else Amp = Strength; FluidActor->FluidSurfaceComponent->Pling( GetActorLocation( ), Amp, Radius );}
开发者ID:Kthulhu,项目名称:FluidSurface,代码行数:22,
示例7: GetWorldvoid ATankAIController::Tick(float DeltaTime){ Super::Tick(DeltaTime); auto PlayerTank = GetWorld()->GetFirstPlayerController()->GetPawn(); auto ControlledTank = GetPawn(); if(!ensure(PlayerTank && ControlledTank)){return ; } //move towards player MoveToActor(PlayerTank, AcceptanceRadius); //aim towards the player auto AimingComponent = ControlledTank->FindComponentByClass<UTankAimingComponent>(); AimingComponent->AimAt(PlayerTank->GetActorLocation()); //Fire if ready if(AimingComponent->GetFiringStatus() == EFiringStatus::Locked) { AimingComponent->Fire(); }}
开发者ID:brolol07,项目名称:04_BattleTanks,代码行数:21,
示例8: SetRootComponentvoid AProjectile::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComponent, FVector NormalImpulse, const FHitResult& Hit){ LaunchBlast->Deactivate(); ImpactBlast->Activate(); ExplosionForce->FireImpulse(); SetRootComponent(ImpactBlast); CollisionMesh->DestroyComponent(); UGameplayStatics::ApplyRadialDamage( this, ProjectileDamage, GetActorLocation(), ExplosionForce->Radius, UDamageType::StaticClass(), TArray<AActor*>() // don't ignore any actors ); auto Timer = FTimerHandle(); GetWorld()->GetTimerManager().SetTimer(Timer, this, &AProjectile::OnTimerExpire, DestroyDelay, false);}
开发者ID:mrharris,项目名称:BattleTank,代码行数:21,
示例9: Reloadvoid AHunterMarxo::Attack(){ if (MainProjectile != NULL) { if (Ammo < 1) { Reload(); return; } MainProjectile ->GetDefaultObject<ABasicProjectile>()->SetDamage(Super::Attack); const FRotator SpawnRotation = CameraArm->GetComponentRotation(); const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(MainOffset); UWorld* const World = GetWorld(); if (World != NULL) { World->SpawnActor<ABasicProjectile>(MainProjectile, SpawnLocation, SpawnRotation); } Ammo--; }}
开发者ID:kcnklub,项目名称:In-The-Palms3d,代码行数:21,
示例10: ifvoid AProjectileSpell::UpdateProjectileVelocity(){ auto character = Cast<ABaseCharacter>(this->GetInstigator()); if (character && character->Controller) { FVector rotator; FVector characterRotation = character->Controller->GetControlRotation().Vector(); if (TargetDirection != FVector(0)) { rotator = TargetDirection; } else if (TargetLocation != FVector(0)) { auto position = character->GetActorLocation(); rotator = UKismetMathLibrary::FindLookAtRotation(position, TargetLocation).Vector(); } else { rotator = characterRotation; } MovementComponent->Velocity = rotator * MovementComponent->InitialSpeed; }}
开发者ID:metsfan,项目名称:thirdpersonproject,代码行数:21,
示例11: GetWorldvoid ATankAIController::Tick(float DeltaTime){ Super::Tick(DeltaTime); auto PlayerTank = GetWorld()->GetFirstPlayerController()->GetPawn(); auto ControlledTank =GetPawn(); if (!ensure(PlayerTank && ControlledTank)) { return; } //Move Towards the player MoveToActor(PlayerTank, AcceptanceRadius); //aim towards the player auto AimingComponent = ControlledTank->FindComponentByClass<UTankAimingComponent>(); AimingComponent->AimAt(PlayerTank->GetActorLocation()); //if aiming or locked if (AimingComponent->GetFiringState() == EFiringState::Locked) { AimingComponent->Fire(); //TODO dont fire every frame , limit fire rate } }
开发者ID:pappszi,项目名称:04_BattleTank,代码行数:21,
示例12: UE_LOGvoid AMeteorProjectile::OnHit(AActor* SelfActor, AActor* OtherActor, FVector NormalImpulse, const FHitResult& Hit){ UE_LOG(LogTemp, Display, TEXT("METEOR HIT")); TArray<FOverlapResult> res; if (GetWorld()->OverlapMultiByChannel(res, GetActorLocation(), FQuat::Identity, ECollisionChannel::ECC_Visibility, FCollisionShape::MakeSphere(300))) { for (auto a : res) { if (a.Actor.IsValid() && Cast<ABaseGamer>(a.Actor.Get())) { a.Actor->TakeDamage(FMath::FRandRange(6000, 16000), FDamageEvent(), GetInstigator() ? GetInstigator()->GetController() : nullptr, this); } } } //DrawDebugSphere(GetWorld(), GetActorLocation(), 300, 16, FColor::Red, false, 1); Destroy();}
开发者ID:Quadtree,项目名称:LD33,代码行数:21,
示例13: GetRootComponentvoid AActor::EditorApplyScale( const FVector& DeltaScale, const FVector* PivotLocation, bool bAltDown, bool bShiftDown, bool bCtrlDown ){ if( RootComponent != NULL ) { const FVector CurrentScale = GetRootComponent()->RelativeScale3D; // @todo: Remove this hack once we have decided on the scaling method to use. FVector ScaleToApply; if( AActor::bUsePercentageBasedScaling ) { ScaleToApply = CurrentScale * (FVector(1.0f) + DeltaScale); } else { ScaleToApply = CurrentScale + DeltaScale; } GetRootComponent()->SetRelativeScale3D(ScaleToApply); if (PivotLocation) { const FVector CurrentScaleSafe(CurrentScale.X ? CurrentScale.X : 1.0f, CurrentScale.Y ? CurrentScale.Y : 1.0f, CurrentScale.Z ? CurrentScale.Z : 1.0f); FVector Loc = GetActorLocation(); Loc -= *PivotLocation; Loc *= (ScaleToApply / CurrentScaleSafe); Loc += *PivotLocation; GetRootComponent()->SetWorldLocation(Loc); } } else { UE_LOG(LogActor, Warning, TEXT("WARNING: EditorApplyTranslation %s has no root component"), *GetName() ); } FEditorSupportDelegates::UpdateUI.Broadcast();}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:40,
示例14: GetActorLocationvoid AInteractDoors::Interact(AActor* Interactor){ if (!bIsLocked) { if (bIsOpen) { bIsOpen = false; } else { bIsOpen = true; } UGameplayStatics::PlaySoundAtLocation(GetWorld(), SoundEffect, GetActorLocation()); UInteractableAnimInstance* DoorAnim = Cast<UInteractableAnimInstance>(SkeletalMesh->GetAnimInstance()); if (DoorAnim) { DoorAnim->bActivated = true; } }}
开发者ID:Snowman5717,项目名称:SymphonyOfShadows,代码行数:22,
示例15: ServerDropWeaponvoid ASCharacter::DropWeapon(){ if (Role < ROLE_Authority) { ServerDropWeapon(); return; } if (CurrentWeapon) { FVector CamLoc; FRotator CamRot; if (Controller == nullptr) return; /* Find a location to drop the item, slightly in front of the player. */ Controller->GetPlayerViewPoint(CamLoc, CamRot); const FVector Direction = CamRot.Vector(); const FVector SpawnLocation = GetActorLocation() + (Direction * DropItemDistance); FActorSpawnParameters SpawnInfo; SpawnInfo.bNoCollisionFail = true; ASWeaponPickup* NewWeaponPickup = GetWorld()->SpawnActor<ASWeaponPickup>(CurrentWeapon->WeaponPickupClass, SpawnLocation, FRotator::ZeroRotator, SpawnInfo); if (NewWeaponPickup) { /* Apply torque to make it spin when dropped. */ UStaticMeshComponent* MeshComp = NewWeaponPickup->GetMeshComponent(); if (MeshComp) { MeshComp->SetSimulatePhysics(true); MeshComp->AddTorque(FVector(1, 1, 1) * 4000000); } } RemoveWeapon(CurrentWeapon); }}
开发者ID:MarcioGeremia,项目名称:EpicSurvivalGameSeries,代码行数:39,
示例16: GetActorLocationvoid SELF::RegisterArtifact(){ int i; AUTCTFFlag* Artifact; FActorSpawnParameters Params; Params.Owner = this; ArtifactNum++; Artifact = (*GetWorld()).SpawnActor<AUTCTFFlag>(TeamFlagTypes[TeamNum], GetActorLocation() + FVector(0,0,96), GetActorRotation(), Params); if (Artifact) { ArtifactIDs.Add(Artifact); (*Artifact).Init(this); // GEm: If not for legacy reasons, could just call Destroy() on the old artifact, but now deactivate the last one for (i = 0; i < ArtifactIDs.Num(); i++) { if (!Cast<AXMPArtifact>(ArtifactIDs[i])->bEnabled) Cast<AXMPArtifact>(ArtifactIDs[i])->Deactivate(); } UpdateLegacy(); }}
开发者ID:saiboat,项目名称:UT4XMPGameMode,代码行数:22,
示例17: GetActorForwardVectorvoid APlayerOvi::BeginPlay() { Super::BeginPlay(); //tag player this->Tags.Add("Player"); // time for button animation m_elapsedAltar = m_elapsedPortal = m_elapsedButton = 0.0f; // material for capsule CapsuleComponent->SetMaterial(0, nullptr); // calculate limit world & initial orientation float dotForward = FVector::DotProduct(FVector(1, 1, 1), GetActorForwardVector()); if (dotForward < 0) m_state = States::LEFT; else m_state = States::RIGHT; m_limit = FVector::DotProduct(GetActorLocation(), GetActorRightVector()); m_limit = abs(m_limit); //GetCaspuleValues for simulate physics m_capsuleHeight = CapsuleComponent->GetScaledCapsuleHalfHeight(); m_capsuleRadious = CapsuleComponent->GetScaledCapsuleRadius(); m_capsuleHeightPadding = m_capsuleHeight * PADDING_COLLISION_PERCENT; m_capsuleRadiousPadding = m_capsuleRadious * PADDING_COLLISION_PERCENT_RADIOUS; m_capsuleHeightPaddingFeet = m_capsuleHeight * PADDING_COLLISION_PERCENT_FEET; //Set player Stick in the animation socket if (Mesh) { m_stick = GetWorld()->SpawnActor<AStick>(AStick::StaticClass()); const USkeletalMeshSocket *socket = Mesh->GetSocketByName("Puntodeacople_Baston"); if (socket) socket->AttachActor(m_stick, Mesh); m_colorKey = FLinearColor(FVector(0.5f)); m_stick->SetColor(FLinearColor(FVector(0.5f)), 5.0f); } m_inTutorial = false; m_isValid = false;}
开发者ID:alfreSosa,项目名称:TowardTheLight,代码行数:39,
示例18: GetActorLocationvoid ALeafNode::DebugDraw(){ const FVector location = GetActorLocation(); if (UWorld* const a_World = Tree->tidGetWorld()) { FColor Color = FColor::Red; //Left FVector Start = FVector(location.X, location.Y, location.Z); FVector End = FVector(location.X, location.Y + Dimensions.Y, location.Z); DrawDebugLine(a_World, Start, End, Color); //Bottom Start = FVector(location.X, location.Y, location.Z); End = FVector(location.X + Dimensions.X, location.Y, location.Z); DrawDebugLine(a_World, Start, End, Color); //Right Start = FVector(location.X + Dimensions.X, location.Y, location.Z); End = FVector(location.X + Dimensions.X, location.Y + Dimensions.Y, location.Z); DrawDebugLine(a_World, Start, End, Color); //Top Start = FVector(location.X + Dimensions.X, location.Y + Dimensions.Y, location.Z); End = FVector(location.X, location.Y + Dimensions.Y, location.Z); DrawDebugLine(a_World, Start, End, Color); // Draw debug box at center of node //const FVector2D roomPosition = FVector2D(location.X + Dimensions.X * 0.5f, location.Y + Dimensions.Y * 0.5f); //DrawDebugBox(a_World, FVector(roomPosition.X, roomPosition.Y, 5.0f), FVector(10.0f), FColor::Blue); }}
开发者ID:timburrows,项目名称:tid,代码行数:39,
示例19: GetActorUpVectorbool ADraggableMoveTile::cameraRayIntersectWithTilePlane( const FVector& camlocation, const FVector& dir, FVector& hitPoint){ bool hitPlane = false; auto planeNormal = GetActorUpVector(); auto demon = FMath::Abs(FVector::DotProduct(dir, planeNormal)); if (demon > FLT_EPSILON) { auto t = FVector::DotProduct(camlocation - GetActorLocation(), planeNormal) / demon; hitPlane = t >= 0; if (hitPlane) { hitPoint = camlocation + dir * t; } } return hitPlane;}
开发者ID:pokelege,项目名称:ProjectTap_Code,代码行数:22,
示例20: GetActorLocation// Called when the game starts or when spawnedvoid AGib::BeginPlay(){ Super::BeginPlay(); FVector Origin = this->GetActorLocation(); //SetActorLocation(FVector(Origin.X, Origin.Y, FloorOffset)); IsAttacked = false; //Applying Impulse force and setting physics on GibMesh1->SetSimulatePhysics(true); GibMesh1->AddRadialImpulse(Origin, ForceRadius, ImpulseForce, ERadialImpulseFalloff::RIF_Linear, true); GibMesh2->SetSimulatePhysics(true); GibMesh2->AddRadialImpulse(Origin, ForceRadius, ImpulseForce, ERadialImpulseFalloff::RIF_Linear, true); GibMesh3->SetSimulatePhysics(true); GibMesh3->AddRadialImpulse(Origin, ForceRadius, ImpulseForce, ERadialImpulseFalloff::RIF_Linear, true); GibMesh4->SetSimulatePhysics(true); GibMesh4->AddRadialImpulse(Origin, ForceRadius, ImpulseForce, ERadialImpulseFalloff::RIF_Linear, true); GibMesh5->SetSimulatePhysics(true); GibMesh5->AddRadialImpulse(Origin, ForceRadius, ImpulseForce, ERadialImpulseFalloff::RIF_Linear, true); GibMesh6->SetSimulatePhysics(true); GibMesh6->AddRadialImpulse(Origin, ForceRadius, ImpulseForce, ERadialImpulseFalloff::RIF_Linear, true); //Play sound effect if (GibSound != NULL) { UGameplayStatics::PlaySoundAtLocation(this, GibSound, GetActorLocation(), 1, 1); } //Spawn Particle //if (Particles != NULL) //{ //}}
开发者ID:TheRealKevinStone,项目名称:Max,代码行数:39,
示例21: ifvoid AAnchovieCharacter::OnActorOverlaping(AActor* OtherActor){ if (OtherActor != GetOwner()) { if (OtherActor->GetName().Contains("Lever")) { LeverToCollideWith = Cast<ALever>(OtherActor); if (LeverToCollideWith != NULL) { if (LeverToCollideWith->GetIsActivated() == true) { LeverToCollideWith->Interact(this); } } } else if (OtherActor->GetName().Contains("Light")) { TheSwitch = Cast<ALightSwitch>(OtherActor); if (TheSwitch != NULL) { if (TheSwitch->GetIsOn() == true) { if (LightOn == false) { LightOn = true; } else { LightOn = false; } } UGameplayStatics::PlaySoundAtLocation(GetWorld(), SplashSound, GetActorLocation()); } } }}
开发者ID:Snowman5717,项目名称:SymphonyOfShadows,代码行数:38,
示例22: GetActorUpVectorvoid APlayerOvi::DoJump(float DeltaSeconds){ if (m_hasLanded && !m_doJump) { m_isJumping = false; m_headCollision = false; } if (m_doJump && !m_isJumping && m_hasLanded) { m_hasLanded = false; m_isJumping = true; m_headCollision = false; m_doJump = false; } FVector up = GetActorUpVector(); FVector location = GetActorLocation(); if (m_isJumping && !m_headCollision) { if (m_actualJumpSpeed > 0) { location += m_actualJumpSpeed * DeltaSeconds * up; m_actualJumpSpeed -= AccelerationJump * DeltaSeconds; if (m_actualJumpSpeed < 0) m_actualJumpSpeed = 0; m_enabledGravity = false; m_isFalling = false; } else { m_actualJumpSpeed = 0; m_isJumping = false; } } else { m_isFalling = !m_hasLanded; m_enabledGravity = true; } SetActorLocation(location);}
开发者ID:alfreSosa,项目名称:TowardTheLight,代码行数:38,
示例23: GetControlRotationvoid ASharpShotCharacter::OnFire(){ // try and fire a projectile if (ProjectileClass != NULL) { const FRotator SpawnRotation = GetControlRotation(); // MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset); UWorld* const World = GetWorld(); if (World != NULL) { // spawn the projectile at the muzzle // World->SpawnActor<ASharpShotProjectile>(ProjectileClass, SpawnLocation, SpawnRotation); this->FireEvent(); } } // try and play the sound if specified if (FireSound != NULL) { //UGameplayStatics::PlaySoundAtLocation(this, FireSound, GetActorLocation()); } // try and play a firing animation if specified if(FireAnimation != NULL) { // Get the animation object for the arms mesh /* UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance(); if(AnimInstance != NULL) { AnimInstance->Montage_Play(FireAnimation, 1.f); } */ }}
开发者ID:Gigakaiser,项目名称:SShot,代码行数:38,
示例24: GetActorLocationvoid ABETCharacter::OnFire(){ if (Weapon){ Weapon->Fire(); } // try and play the sound if specified if (Weapon->FireSound != NULL) { UGameplayStatics::PlaySoundAtLocation(this, Weapon->FireSound, GetActorLocation()); } // try and play a firing animation if specified if (Weapon->FireAnimation != NULL) { // Get the animation object for the arms mesh UAnimInstance* AnimInstance = Mesh1P->GetAnimInstance(); if (AnimInstance != NULL) { AnimInstance->Montage_Play(Weapon->FireAnimation, 1.f); } }}
开发者ID:brandon2499,项目名称:14BirdsEyeTerrace,代码行数:23,
示例25: TeamXMLParservoid ARobot::BeginPlay(){ Super::BeginPlay(); staminaTime = 0; tryStopBall = false; oldMoveToTarget = FVector::ZeroVector; oldMoveToSpeed = 0; oldMoveToStamina = 0; oldMoveToDistance = 0; TeamXMLParser* parser = new TeamXMLParser(); int teamID = team; int playerNumber; if (teamID == 1) playerNumber = playerId; else playerNumber = playerId - 11; //Set start Postion out of the XML file: startLocation = parser->getPlayerStartLocation(teamID, playerNumber); FVector loc = GetActorLocation(); startLocation.Z = loc.Z; this->SetActorLocation(startLocation); luaFile = parser->getScriptLocation(teamID, playerNumber);}
开发者ID:RocketRider,项目名称:UnrealCup,代码行数:23,
示例26: SimulateExplosionFXvoid ABomb::Explode(){ SimulateExplosionFX(); //We won't use any specific damage types in our case TSubclassOf<UDamageType> DmgType; //Do not ignore any actors TArray<AActor*> IgnoreActors; //This will eventually call the TakeDamage function that we have overriden in the Character class UGameplayStatics::ApplyRadialDamage(GetWorld(), ExplosionDamage, GetActorLocation(), ExplosionRadius, DmgType, IgnoreActors, this, GetInstigatorController()); FTimerHandle TimerHandle; FTimerDelegate TimerDel; TimerDel.BindLambda([&]() { Destroy(); }); //Destroy the actor after 0.3 seconds. GetWorld()->GetTimerManager().SetTimer(TimerHandle, TimerDel, 0.3f, false);}
开发者ID:orfeasel,项目名称:UE4-Game-Systems,代码行数:23,
示例27: FVectorvoid ACullingMaze::SpawnWalls() { AMazeWall* CurrentWall; FVector LocationOffset; for (int y = 0; y < MazeLengthInTiles; y++) { Row[y].ColumnWallRef.SetNum(MazeLengthInTiles); for (int x = 0; x < MazeLengthInTiles; x++) { CurrentWall = Cast<AMazeWall>(GetWorld()->SpawnActor(WallClass)); if (CurrentWall) { LocationOffset = FVector((float)(x)* TileSize, (float)(y)* TileSize, -InnerWallHeight + FloorHeight - FloorClippingPreventionOffset); CurrentWall->SetActorLocation(GetActorLocation() + LocationOffset); CurrentWall->SetActorScale3D(WallScale); Row[y].ColumnWallRef[x] = CurrentWall; } } }}
开发者ID:mleavell,项目名称:TheGauntlet,代码行数:23,
示例28: LoadMainMenuvoid AFPSHorrorCharacter::ShootBloodBall(){ Health -= 10; if (Health <= 0) { LoadMainMenu(); } if (ProjectileClass != NULL) { const FRotator SpawnRotation = GetControlRotation(); // MuzzleOffset is in camera space, so transform it to world space before offsetting from the character location to find the final muzzle position //const FVector SpawnLocation = GetActorLocation() + SpawnRotation.RotateVector(GunOffset); const FVector SpawnLocation = GetActorLocation(); UWorld* const World = GetWorld(); if (World != NULL) { // spawn the projectile at the muzzle World->SpawnActor<AFPSHorrorProjectile>(ProjectileClass, SpawnLocation, SpawnRotation); } }}
开发者ID:Rish79,项目名称:FPS-Horror,代码行数:23,
|