public bool SE_CheckForPinHasFallen() { //GetOwner().PrintString("SE_CheckForPinHasFallen", FLinearColor.Green, printToLog: true); FVector _rotationInEuler = MyOwner.GetActorRotation().Euler(); float _tiltInX = FMath.Abs(_rotationInEuler.X); float _tiltInY = FMath.Abs(_rotationInEuler.Y); bool _previouslyFallen = bPinHasFallen; bPinHasFallen = _tiltInX > standingThreshold || _tiltInY > standingThreshold; if (bDebugInstantStrike) { bPinHasFallen = true; } if (bPinHasFallen && _previouslyFallen != bPinHasFallen) { gamemaster.CallOnPinHasFallen(this); } else if (bPinHasFallen == false && _previouslyFallen != bPinHasFallen && bDebugInstantStrike == false) { //If Pin Has Gotten Back Up Because //Pin Has Fallen, But Now PinHasFallen Equals False //MyOwner.PrintString("Pin has gotten back up", FLinearColor.Green, printToLog: true); gamemaster.CallOnPinHasGottenBackUp(this); } return(bPinHasFallen); }
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(); }