예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (transform.position.x <= slow && m.GetSpeed() > 0)
        {
            m.AddSpeed(Time.deltaTime * accelerator);
        }

        if (transform.position.x >= -slow && m.GetSpeed() < 0)
        {
            m.AddSpeed(Time.deltaTime * -accelerator);
        }
    }