Exemple #1
0
        void AttachToParentWithOldPosition()
        {
            var        _pinManagerBP = pinManager.MyOwner;
            FHitResult _hit;
            FVector    _oldLoc = MyOwner.GetActorLocation();
            FRotator   _oldRot = MyOwner.GetActorRotation();

            MyOwner.AttachToActor(_pinManagerBP, _pinManagerBP.GetAttachParentSocketName(),
                                  EAttachmentRule.KeepRelative, EAttachmentRule.KeepRelative, EAttachmentRule.KeepWorld, true);
            MyOwner.SetActorLocation(_oldLoc, false, out _hit, false);
            MyOwner.SetActorRotation(_oldRot, false);
        }
        public override void BeginPlay()
        {
            //base.ReceiveBeginPlay_Implementation();
            //LaunchBall();
            gamemaster.BowlTurnIsFinished += BowlTurnIsFinished;
            gamemaster.BowlNewTurnIsReady += NewTurnIsReady;
            //gamemaster.BowlTurnIsFinishedTest.Bind(BowlTurnIsFinished);
            gamemaster.OnBallLaunch     += LaunchBall;
            gamemaster.OnNudgeBallLeft  += NudgeBallLeft;
            gamemaster.OnNudgeBallRight += NudgeBallRight;

            MyStartLocation = MyOwner.GetActorLocation();
            MyStartRotation = MyOwner.GetActorRotation();
        }
        void NudgeBallRight(float famount)
        {
            FHitResult _hit;

            MyOwner.SetActorLocation(
                MyOwner.GetActorLocation() +
                new FVector(0, famount, 0), false, out _hit, false);

            if (BallNudgeSound != null)
            {
                MyAudioSourceComponent.Sound = BallNudgeSound;
                MyAudioSourceComponent.Play();
            }
        }