예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        RugbyBall ball = other.GetComponent <RugbyBall>();

        if (ball != null)
        {
            ball.GetComponent <Rigidbody>().velocity    = Vector3.zero;
            ball.GetComponent <Rigidbody>().isKinematic = true;
            ball.transform.SetParent(transform);
        }
    }
예제 #2
0
 private void Awake()
 {
     _allOtherPlayers = FindObjectsOfType <Passing>().Where(t => t != this).ToArray();
     _ball            = FindObjectOfType <RugbyBall>();
 }