예제 #1
0
파일: Move.cs 프로젝트: lord8266/Infinite
    // Update is called once per frame
    void Update()
    {
        // Debug.Log(speed);
        float x = transform.position.x;

        if (x < -200)
        {
            //  Debug.Log("here");
            transform.Translate(new Vector3(400, 0, 0), Space.World);
            hazard.Activate();
        }
        transform.Translate(-new Vector3(speed * Time.deltaTime, 0, 0), Space.World);
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        Transform t = g1.transform;
        float     x = g1.transform.position.x;

        if (x < -200)
        {
            //  Debug.Log("here");
            t.Translate(new Vector3(400, 0, 0), Space.World);
            hazard1.Activate();
        }
        t.Translate(-new Vector3(speed * Time.deltaTime, 0, 0), Space.World);

        t = g2.transform;
        x = g2.transform.position.x;
        if (x < -200)
        {
            //  Debug.Log("here");
            t.Translate(new Vector3(400, 0, 0), Space.World);
            hazard2.Activate();
        }
        t.Translate(-new Vector3(speed * Time.deltaTime, 0, 0), Space.World);
    }