Esempio n. 1
0
    void FixedUpdate()
    {
        transform.Translate(new Vector3(0, 0, -1 * progressManagerRef.GetGameSpeed() * Time.deltaTime));

        if (Mathf.Abs(transform.position.z - carRef.position.z) <= 0.01)  //!!!!!!!!!!!!!!!!!!!!!!!!
        {
            Destroy(gameObject);
        }
    }
Esempio n. 2
0
    void Update()
    {
        foreach (GameObject r in roadList)
        {
            r.transform.Translate(new Vector3(0, 0, -1 * progressManagerRef.GetGameSpeed() * Time.deltaTime));

            if (r.transform.position.z <= -35)
            {
                Vector3 oldPos = r.transform.position;
                oldPos.z             = 60;
                r.transform.position = oldPos;
            }
        }
    }