Exemple #1
0
    private void Awake()
    {
        a        = true;
        isStart  = false;
        NeedBack = false;
        NeedTurn = false;
        addturn  = 1;
        LR       = 0;

        // get the car controller reference
        m_CarController = GetComponent <RMCRealisticMotorcycleController>();

        Debug.Log(m_CarController);

        // give the random perlin a random value
        m_RandomPerlin = Random.value * 100;

        m_Rigidbody = GetComponent <Rigidbody>();
    }
Exemple #2
0
    void Start()
    {
        if (dummyIllumin)
        {
            illumin = dummyIllumin.GetComponent <MeshRenderer>().material.shader;
        }
        else
        {
            illumin = Shader.Find("Self-Illumin/Specular");
        }

        defaultShader = Shader.Find("Bumped Specular");
        motorScript   = GetComponent <RMCRealisticMotorcycleController>();

        lightSources             = new Light[lights.Length];
        rightSignalsLightSources = new Light[rightSignals.Length];
        leftSignalsLightSources  = new Light[leftSignals.Length];
        miscLightSources         = new Light[miscLights.Length];
        headLightLightSource     = new Light();
        headLightLightSource     = headLight.GetComponentInChildren <Light>();

        for (int i = 0; i < lights.Length; i++)
        {
            lightSources[i] = lights[i].GetComponentInChildren <Light>();
        }
        for (int i = 0; i < rightSignals.Length; i++)
        {
            rightSignalsLightSources[i] = rightSignals[i].GetComponentInChildren <Light>();
        }
        for (int i = 0; i < leftSignals.Length; i++)
        {
            leftSignalsLightSources[i] = leftSignals[i].GetComponentInChildren <Light>();
        }
        for (int i = 0; i < miscLights.Length; i++)
        {
            miscLightSources[i] = miscLights[i].GetComponentInChildren <Light>();
        }

        StartCoroutine(FlashLights());
        StartCoroutine(SignalLights());
        StartCoroutine(MiscLights());
    }
Exemple #3
0
 void Awake()
 {
     motorScript = (RMCRealisticMotorcycleController)target;
 }