コード例 #1
0
        void NewBowlTurnHasStarted(EBowlAction _action)
        {
            if (bHitFirstPin.Get(this) == true)
            {
                bHitFirstPin.Set(this, false);
            }

            if (bPinHasFallen)
            {
                //Destroy Pin If It Hasn't Been Sweeped Into the Floor
                MyOwner.DestroyActor();
            }
            else if (MyColliderMeshComponent != null)
            {
                MyColliderMeshComponent.SetSimulatePhysics(true);
            }
        }
コード例 #2
0
 /// <summary>
 /// Took Part Of BeginPlay Code Out Because It Depends On Initialization
 /// Which Should Be Called On Begin Play Inside Blueprints
 /// </summary>
 private void MyBeginPlayPostInitialization()
 {
     if (pinManager != null)
     {
         if (MyColliderMeshComponent != null)
         {
             AttachToParentWithOldPosition();
             MyColliderMeshComponent.SetSimulatePhysics(false);
             MyColliderMeshComponent.SetSimulatePhysics(true);
         }
         else
         {
             MyOwner.PrintString("Please Attach Collider Mesh To Pin Comp UProperty", FLinearColor.Red, printToLog: true);
         }
     }
     else
     {
         MyOwner.PrintString("Couldn't Find Pin Manager Component", FLinearColor.Red, printToLog: true);
     }
 }
コード例 #3
0
        void OnSendBowlActionResults(EBowlAction _action)
        {
            var _pinManager = pinManager;

            //Only If Collider Mesh Comp Has Been Assigned AND
            //Parent Actor is the PinManager Actor Blueprint
            if (MyColliderMeshComponent != null &&
                _pinManager != null &&
                bPinHasFallen == false)
            {
                if (_action == EBowlAction.Tidy)
                {
                    AttachToParentWithOldPosition();
                    MyColliderMeshComponent.SetSimulatePhysics(false);
                }
                else
                {
                    MyColliderMeshComponent.SetSimulatePhysics(true);
                }
            }
        }