Ejemplo n.º 1
0
    void Initialize()
    {
        // If no body was manually assigned, see if the parents have one
        if (!_body)
        {
            _body = PhysicsUtils.GetRigidBodyInParents(transform);
            if (!_body)
            {
                _initialized = false;
                Debug.LogError(string.Format("Suspension '{0}' failed to initialize, no rigidbody assigned or found in hierarchy", name));
            }
        }

        if (_body)
        {
            _initialized = true;
        }
    }