Exemple #1
0
    void  Start()
    {
        wheel_col    = GetComponent <WheelCollider>();
        vehicleRigid = vehicle.GetComponent <Rigidbody>();

        if (FindObjectOfType(typeof(RCCSkidmarks)))
        {
            skidmarks = FindObjectOfType(typeof(RCCSkidmarks)) as RCCSkidmarks;
        }
        else
        {
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''SkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");
        }
    }
Exemple #2
0
    void  Start()
    {
        wheelCollider = GetComponent <WheelCollider>();
        carController = GetComponentInParent <RCCCarControllerV2>();
        carRigid      = carController.GetComponent <Rigidbody>();

        if (FindObjectOfType(typeof(RCCSkidmarks)))
        {
            skidmarks = FindObjectOfType(typeof(RCCSkidmarks)) as RCCSkidmarks;
        }
        else
        {
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");
        }

        forwardFrictionCurve  = GetComponent <WheelCollider>().forwardFriction;
        sidewaysFrictionCurve = GetComponent <WheelCollider>().sidewaysFriction;
    }
Exemple #3
0
    void  Start()
    {
        Instance = this;

        if (transform.position != Vector3.zero)
        {
            transform.position = Vector3.zero;
        }

                #if ClientCode
        skidmarks = new markSection[maxMarks];
        for (int i = 0; i < maxMarks; i++)
        {
            skidmarks[i] = new markSection();
        }

        mesh = GetComponent <MeshFilter>().mesh;

        if (mesh == null)
        {
            GetComponent <MeshFilter>().mesh = new Mesh();
        }
                #endif
    }
    void  Start()
    {
        wheelCollider = GetComponent <WheelCollider>();
        carController = transform.root.GetComponent <RCCCarControllerV2>();
        carRigid      = carController.GetComponent <Rigidbody>();

        if (FindObjectOfType(typeof(RCCSkidmarks)))
        {
            skidmarks = FindObjectOfType(typeof(RCCSkidmarks)) as RCCSkidmarks;
        }
        else
        {
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");
        }

        grassPhysicsMaterial = Resources.Load("RCCGrassPhysics") as PhysicMaterial;
        sandPhysicsMaterial  = Resources.Load("RCCSandPhysics") as PhysicMaterial;

        forwardFrictionCurve  = GetComponent <WheelCollider>().forwardFriction;
        sidewaysFrictionCurve = GetComponent <WheelCollider>().sidewaysFriction;

        defForwardStiffness  = forwardFrictionCurve.stiffness;
        defSidewaysStiffness = sidewaysFrictionCurve.stiffness;
    }
    void Start()
    {
        wheelCollider = GetComponent<WheelCollider>();
        carController = transform.root.GetComponent<RCCCarControllerV2>();
        carRigid = carController.GetComponent<Rigidbody>();

        if(FindObjectOfType(typeof(RCCSkidmarks)))
            skidmarks = FindObjectOfType(typeof(RCCSkidmarks)) as RCCSkidmarks;
        else
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");

        grassPhysicsMaterial = Resources.Load("RCCGrassPhysics") as PhysicMaterial;
        sandPhysicsMaterial = Resources.Load("RCCSandPhysics") as PhysicMaterial;

        forwardFrictionCurve = GetComponent<WheelCollider>().forwardFriction;
        sidewaysFrictionCurve = GetComponent<WheelCollider>().sidewaysFriction;

        defForwardStiffness = forwardFrictionCurve.stiffness;
        defSidewaysStiffness = sidewaysFrictionCurve.stiffness;
    }
    void Start()
    {
        wheelCollider = GetComponent<WheelCollider>();
        carController = GetComponentInParent<RCCCarControllerV2>();
        carRigid = carController.GetComponent<Rigidbody>();

        if(FindObjectOfType(typeof(RCCSkidmarks)))
            skidmarks = FindObjectOfType(typeof(RCCSkidmarks)) as RCCSkidmarks;
        else
            Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene...");

        forwardFrictionCurve = GetComponent<WheelCollider>().forwardFriction;
        sidewaysFrictionCurve = GetComponent<WheelCollider>().sidewaysFriction;
    }