Пример #1
0
    // Update is called once per frame
    void Update()
    {
        unitychan c3 = refObj3.GetComponent <unitychan>();
        Plate1    c4 = refObj4.GetComponent <Plate1>();

        animator.SetBool(doWalkId, true);
        Debug.Log("true");

        if (c3.transform.position.x < unitychan.setPos.x)
        {
            c3.transform.position += new Vector3(6f * Time.deltaTime, 0f, 0f);
        }

        else if (c3.transform.position.x >= unitychan.setPos.x && c4.transform.position.z > 0)
        {
            animator.SetBool(doWalkId, false);
        }

        else if (c4.transform.position.z <= 0 && c3.transform.position.x < 18f)
        {
            animator.SetBool(doWalkId, true);
            Debug.Log("true");
            c3.transform.position += new Vector3(6f * Time.deltaTime, 0f, 0f);
        }

        else if (c3.transform.position.x >= 18f)
        {
            animator.SetBool(doWalkId, false);
            Debug.Log("false");
        }
    }
Пример #2
0
    void Update()
    {
        Debug.Log(transform.position.x);
        unitychan c2 = refObj2.GetComponent <unitychan>();

        if (c2.transform.position.x >= unitychan.setPos2.x && Input.GetKey(KeyCode.UpArrow) &&
            transform.position.y < setPos.y)
        {
            transform.position += new Vector3(0f, 1f * Time.deltaTime, 0f);
        }
    }
Пример #3
0
    void Update()
    {
        Debug.Log(transform.position.x);
        unitychan c1 = refObj1.GetComponent <unitychan>();


        if (c1.transform.position.x >= unitychan.setPos.x && Input.GetKey(KeyCode.DownArrow) &&
            transform.position.z > setPos.z)
        {
            transform.position += new Vector3(0f, 0f, -1f * Time.deltaTime);
        }
    }
Пример #4
0
    void Update()
    {
        Debug.Log(transform.position.x);
        unitychan c2 = refObj2.GetComponent <unitychan>();

        if (c2.transform.position.x >= unitychan.setPos.x && flag2 == true)
        {
            transform.position = new Vector3(39.5f, 5f, 0f);

            flag2 = false;
            Debug.Log("tekito");
        }
    }