Beispiel #1
0
        void Start()
        {
            var pos = transform.position;

            pos.x = ((float)(lane) - 1.5f) * 1.0f;
            pos.z = RoadConstants.MaxRoadZ;
            transform.position = NumericalCurve.SnapYToCurve(pos);
        }
Beispiel #2
0
        // Update is called once per frame
        void FixedUpdate()
        {
            Vector3 pos = transform.position / SCALE;

            NumericalCurve.IntegrateStep(ref pos);
            transform.position = pos * SCALE;
            if (transform.position.z < 0.01f)
            {
                transform.position = NumericalCurve.SnapYToCurve(new Vector3(0, 0, START_Z));
            }
        }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     transform.position = NumericalCurve.SnapYToCurve(new Vector3(0, 0, START_Z));
 }