public void CallOnBallLaunch(FVector launchVelocity, UBowlingBallComponent bowlingBall)
 {
     bCanLaunchBall = false;
     if (OnBallLaunch != null)
     {
         OnBallLaunch(launchVelocity, bowlingBall);
     }
 }
Пример #2
0
 public void SetBallFromBallFindCollection(List <AActor> balls)
 {
     if (balls != null && balls.Count > 0 && balls[0] != null)
     {
         var _ballComp = balls[0].GetComponentByClass <UBowlingBallComponent>();
         if (_ballComp != null)
         {
             myBall = _ballComp;
         }
     }
 }
Пример #3
0
 void StartFollowingBall(FVector launchVelocity, UBowlingBallComponent bowlingBall)
 {
     myBall = bowlingBall;
     if (myBall != null)
     {
         DefaultBallFollowOffset = MyOwner.GetActorLocation().X - myBall.MyOwner.GetActorLocation().X;
         bShouldFollowBall       = true;
     }
     else
     {
         bShouldFollowBall = false;
     }
 }
 void LaunchBall(FVector launchVelocity, UBowlingBallComponent bowlingBall)
 {
     if (MyMeshComponent == null)
     {
         MyOwner.PrintString("Please Assign A mesh component to the uproperty", FLinearColor.OrangeRed);
     }
     else if (MyAudioSourceComponent == null)
     {
         MyOwner.PrintString("Please Assign an audio component to the uproperty", FLinearColor.OrangeRed);
     }
     else if (BallRollingSound == null)
     {
         MyOwner.PrintString("Please Assign a sound clip to the ball rolling sound uproperty", FLinearColor.OrangeRed);
     }
     else
     {
         MyMeshComponent.AddImpulse(launchVelocity, MyMeshComponent.GetAttachSocketName(), true);
         MyAudioSourceComponent.Sound = BallRollingSound;
         MyAudioSourceComponent.Play();
     }
 }