예제 #1
0
 public void OnSwerveUpdate(CrateController crate, float rotateByAngle, Vector3 rotationPivot, Vector3 zVector)
 {
     if (crate == topCrate)
     {
         letter.transform.RotateAround(rotationPivot, zVector, rotateByAngle);
     }
 }
예제 #2
0
        public void OnCrateHit(CrateController crate)
        {
            ThrowBallsConfiguration.Instance.Context.GetAudioManager().PlaySound(Sfx.CrateLandOnground);

            crate.Launch(new Vector3(0, 0, 1), 30);

            middleCrate.ApplyCustomGravity();
            middleCrate.SetIsKinematic(false);
            middleCrate.VanishAfterDelay(0.7f);
            if (middleCrate.IsSwerving())
            {
                middleCrate.StopSwerving();
            }

            topCrate.ApplyCustomGravity();
            topCrate.SetIsKinematic(false);
            topCrate.VanishAfterDelay(0.9f);
            if (topCrate.IsSwerving())
            {
                topCrate.StopSwerving();
            }

            bottomCrate.ApplyCustomGravity();
            bottomCrate.SetIsKinematic(false);
            bottomCrate.VanishAfterDelay(1.1f);
            if (bottomCrate.IsSwerving())
            {
                bottomCrate.StopSwerving();
            }

            //letter.PropUp(1.75f);

            if (letter.IsJumping())
            {
                letter.StopJumping();
            }

            letter.MakeSureIsProppedUp(1.5f);

            letter.SetIsKinematic(false);
            letter.ApplyCustomGravity();

            if (!hit)
            {
                BallController.instance.Reset();
                GameState.instance.OnBallLost();
                hit = true;
            }
        }