Esempio n. 1
0
    private void CheckOnShuttle()
    {
        RaycastHit hit;

        if (Physics.Raycast(transform.position + new Vector3(-_collider.radius / 2 - 0.05f, _collider.height / 2, 0), Vector3.down, out hit, (_collider.height / 2) + 0.1f) ||
            Physics.Raycast(transform.position + new Vector3(_collider.radius / 2 + 0.05f, _collider.height / 2, 0), Vector3.down, out hit, (_collider.height / 2) + 0.1f))
        {
            if (hit.transform.gameObject.GetComponent <Shuttle>())
            {
                _shuttle = hit.transform.gameObject.GetComponent <Shuttle>();
                _shuttle.StartShuttle();
                ShuttlePlayer();
            }
        }
    }