private void Start()
        {
            _wheelCollisionDetector = GetComponent <IWheelCollisionDetector>();

            if (_wheelCollisionDetector == null)
            {
                Debug.LogWarning($"Missing {nameof(IWheelCollisionDetector)} in {transform.name}");
            }
        }
示例#2
0
        private void Start()
        {
            _rb = GetComponentInParent <Rigidbody>();
            _wheelCollisionDetector = GetComponent <IWheelCollisionDetector>();
            _wheel = GetComponent <IWheel>();

            if (_rb == null)
            {
                Debug.LogWarning($"Missing {nameof(Rigidbody)} in parent of {transform.name}");
            }

            if (_wheelCollisionDetector == null)
            {
                Debug.LogWarning($"Missing {nameof(IWheelCollisionDetector)} in {transform.name}");
            }

            if (_wheel == null)
            {
                Debug.LogWarning($"Missing {nameof(IWheel)} in {transform.name}");
            }
        }