Esempio n. 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == GameManager.instance.GetCharacter())
        {
            GameManager.instance.SetGameOver();
            Rigidbody rb            = GameManager.instance.GetCharacter().GetComponent <Rigidbody>();
            Vector3   bumpDirection = transform.right;
            if (isLeft)
            {
                bumpDirection = -transform.right;
            }

            rb.AddForce(bumpDirection * 5, ForceMode.Impulse);
            moveCam.BeginPullBack();
        }
    }