Ejemplo n.º 1
0
 void OnMouseDrag()
 {
     vec    = roomCamera.instance.cam.ScreenToWorldPoint(Input.mousePosition);
     vec.z  = 0;
     vec.y += 0.5f;
     transform.position = vec;
     if (MyConst.equal(vec, fin, 0.6f))
     {
         gameObject.SetActive(false);
         RoomUI.instance.b_right.SetActive(true);
     }
 }
Ejemplo n.º 2
0
    void OnMouseDrag()
    {
        if (!can)
        {
            return;
        }
        Vector3 vec = roomCamera.instance.cam.ScreenToWorldPoint(Input.mousePosition);

        vec.z  = 0;
        vec.y += 0.5f;
        transform.position = vec;
        if (MyConst.equal(vec, fin, 0.6f))
        {
            gameObject.SetActive(false);
            RoomUI.instance.b_left.SetActive(true);
            roomScr.instance.didProgress();
        }
    }
Ejemplo n.º 3
0
    void Update()
    {
        vec = Input.mousePosition;
        //vec.y += CS;
        //CS = Screen.width / 16;

        /*
         * if (Input.GetMouseButtonDown(0))
         * {
         *  flag = MyConst.equal(leftButton.transform.position, vec, CS);
         *  dx = leftButton.transform.position.x - vec.x;
         *  dy = leftButton.transform.position.y - vec.y;
         * }*/

        if (flag)
        {
            vec.y += dy;
            vec.x += dx;
            if (MyConst.equal(vec, pos2, CS * 0.7f) && !flag2)
            {
                flag2 = true;
                upButton.SetActive(true);
                leftButton.SetActive(false);
            }
            else
            {
                da  = (MyConst.dist(pos2, leftButton.transform.position) / allD);
                da  = (da < 0) ? 0 : (da > 1) ? 1: da;
                da  = 1 - da;
                da *= -90;
                leftButton.transform.rotation = Quaternion.Euler(new Vector3(0, 0, da));
                leftButton.transform.position = vec;
            }
        }

        if (Input.GetMouseButtonUp(0))
        {
            flag = false;
        }
    }