예제 #1
0
    // Use this for initialization
    void Awake()
    {
        library = GameObject.FindObjectOfType <Library>();

        m_WheelMeshLocalRotations = new Quaternion[4];
        for (int i = 0; i < 4; i++)
        {
            m_WheelMeshLocalRotations[i] = m_WheelMeshes[i].transform.localRotation;
        }
        m_WheelColliders[0].attachedRigidbody.centerOfMass = m_CentreOfMassOffset;

        m_MaxHandbrakeTorque = float.MaxValue;

        m_Rigidbody     = GetComponent <Rigidbody>();
        m_CurrentTorque = m_FullTorqueOverAllWheels - (m_TractionControl * m_FullTorqueOverAllWheels);

        rideEffect = transform.FindChild("Particles").FindChild("RideEffect").GetComponent <Particle>();

        asotSystems = transform.FindChild("Particles").FindChild("AsotSystems");


        UpdateMaxSpeed();

        rayAsot    = transform.FindChild("Particles").FindChild("RayAsot").GetComponentsInChildren <ParticleSystem>();
        carContact = GetComponent <CarContact>();


        poddon = GameObject.FindObjectOfType <Poddon>();
    }
예제 #2
0
    // Use this for initialization
    void Awake()
    {
        library = GameObject.FindObjectOfType<Library>();

        m_WheelMeshLocalRotations = new Quaternion[4];
        for (int i = 0; i < 4; i++)
        {
            m_WheelMeshLocalRotations[i] = m_WheelMeshes[i].transform.localRotation;
        }
        m_WheelColliders[0].attachedRigidbody.centerOfMass = m_CentreOfMassOffset;

        m_MaxHandbrakeTorque = float.MaxValue;

        m_Rigidbody = GetComponent<Rigidbody>();
        m_CurrentTorque = m_FullTorqueOverAllWheels - (m_TractionControl*m_FullTorqueOverAllWheels);

        rideEffect = transform.FindChild("Particles").FindChild("RideEffect").GetComponent<Particle>();

        asotSystems = transform.FindChild("Particles").FindChild("AsotSystems");

        UpdateMaxSpeed();

        rayAsot = transform.FindChild("Particles").FindChild("RayAsot").GetComponentsInChildren<ParticleSystem>();
        carContact = GetComponent<CarContact>();

        poddon = GameObject.FindObjectOfType<Poddon>();
    }