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; }
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); } }
private void Awake() { ballState = gameObject.GetComponent <BallState>(); }