Beispiel #1
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 #2
0
        void FixedUpdate()
        {
            if (GameObject.Find("CarKey").GetComponent <CarKey>().engineRunning)
            {
                NumericalCurve.IntegrateStep(gameObject);

                step++;

                if (step > RoadConstants.NumIntegrationSteps)
                {
                    GameObject.Destroy(gameObject);
                }
            }
        }