Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Z))
     {
         map.Del();
     }
     if (Input.GetKey(KeyCode.X))
     {
         map.NewLine(true);
     }
 }
Exemple #2
0
    void Update()
    {
        if (Mathf.Repeat(Time.time, 0.5f) >= 0.49f)
        {
            map.NewLine(true);
        }
        if (Input.GetKeyDown(KeyCode.Z))
        {
            map.Del();
        }
        if (Input.GetKey(KeyCode.X))
        {
            map.NewLine(true);
        }

        if (Input.GetKey(KeyCode.D) && isLook)
        {
            isLook = false;
            goR    = true;
            goRi   = 0;
            vector = transform.position;
            transform.RotateAround(new Vector3(vector.x + b / 4, 1.5f, vector.z + b / 4), new Vector3(1, 0, -1), 6);
        }
        if (goR)
        {
            goRi += 6;
            if (goRi < 90)
            {
                //Debug.Log(transform.eulerAngles.x);
                transform.RotateAround(new Vector3(vector.x + b / 4, 1.5f, vector.z + b / 4), new Vector3(1, 0, -1), 6);
            }
            else
            {
                isLook = true;
                goR    = false;
                goRi   = 0;
            }
        }

        if (Input.GetKey(KeyCode.A) && isLook)
        {
            isLook = false;
            goL    = true;
            vector = transform.position;
            transform.RotateAround(new Vector3(vector.x - b / 4, 1.5f, vector.z + b / 4), new Vector3(1, 0, 1), 6);
        }
        if (goL)
        {
            goLi += 6;
            if (goLi < 90)
            {
                //Debug.Log(goLi);
                transform.RotateAround(new Vector3(vector.x - b / 4, 1.5f, vector.z + b / 4), new Vector3(1, 0, 1), 6);
            }
            else
            {
                isLook = true;
                goL    = false;
                goLi   = 0;
            }
        }
    }