コード例 #1
0
 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;
     }
 }
コード例 #4
0
 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();
     }
 }