Пример #1
0
        private void Awake()
        {
            ballState = GetComponent <BallState>();
            rigidbody = GetComponent <Rigidbody>();

            leftHandSource  = SteamVR_Input_Sources.LeftHand;
            rightHandSource = SteamVR_Input_Sources.RightHand;

            anyHandSource = SteamVR_Input_Sources.Any;

            ballState.BaseState   = BaseState.Hovering;
            initialPosition       = transform.localPosition;
            rigidbody.isKinematic = true;
        }
Пример #2
0
        private void OnTriggerEnter(Collider other)
        {
            BallState ballState = other.GetComponentInParent <BallState>();

            if (ballState && ballState.CollisionState == CollisionState.Teleport)
            {
                DOTween.Sequence()
                .AppendInterval(10f)
                .AppendCallback(() => {
                    solidColorOverlay.DOColor(Color.black, 1f);
                    textManager.ShowText(PopUpType.Alert, "You beat the game! Can you find any other paths through the castle?", successScreenDuration);
                })
                .AppendInterval(successScreenDuration)
                .AppendCallback(() => {
                    Destroy(playerRoot);
                    SceneManager.LoadScene("MainScene");
                });

                Destroy(this);
            }
        }
Пример #3
0
 private void Awake()
 {
     ballState = gameObject.GetComponent <BallState>();
 }