--------------------------------------------------------------------------------------------------------------------------
| 456 | |
| 457 | //-------------------------------------------------------------------------------------------------------------------------- |
| 458 | void UCogSampleProjectileComponent::TryHit(const FHitResult& HitResult) |
| 459 | { |
| 460 | COG_LOG_OBJECT(LogCogProjectile, ELogVerbosity::Verbose, Creator.Get(), TEXT("Projectile:%s | Role:%s | Other:%s | Comp:%s | Bone:%s"), |
| 461 | *GetNameSafe(GetOwner()), |
| 462 | *GetRoleName(), |
| 463 | *GetNameSafe(HitResult.GetActor()), |
| 464 | *GetNameSafe(HitResult.GetComponent()), |
| 465 | *HitResult.BoneName.ToString()); |
| 466 | |
| 467 | //----------------------------------------------------------------------------------------- |
| 468 | // User defined callback for gameplay logic |
| 469 | //----------------------------------------------------------------------------------------- |
| 470 | if (ShouldHit(HitResult) == false) |
| 471 | { |
| 472 | COG_LOG_OBJECT(LogCogProjectile, ELogVerbosity::Verbose, Creator.Get(), TEXT("Skipped by ShouldHit callback")); |
| 473 | return; |
| 474 | } |
| 475 | |
| 476 | HitActors.Add(HitResult.GetActor()); |
| 477 | |
| 478 | //----------------------------------------------------------------------------------------- |
| 479 | // User defined callback to decide what should happen to projectile (Stop, Attach, ...) |
| 480 | //----------------------------------------------------------------------------------------- |
| 481 | FCogSampleHitConsequence HitConsequence; |
| 482 | Hit(HitResult, HitConsequence); |
| 483 | |
| 484 | if (HitConsequence.Stop) |
| 485 | { |
| 486 | //InternalStop(HitResult, HitConsequence); |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | //-------------------------------------------------------------------------------------------------------------------------- |
| 491 | void UCogSampleProjectileComponent::StopSimulating(const FHitResult& HitResult) |