Exemplo n.º 1
0
        private void SaveCoord()
        {
            Rect rect = UIScreenTool.UIToScreenRect(canvas, currRect);

            rect.height = rect.height * Screen.height / Screen.width;
            PlayerPrefs.SetFloat("RuleElem_" + id + "_x", rect.x);
            PlayerPrefs.SetFloat("RuleElem_" + id + "_y", rect.y);
            PlayerPrefs.SetFloat("RuleElem_" + id + "_width", rect.width);
            PlayerPrefs.SetFloat("RuleElem_" + id + "_height", rect.height);
        }
Exemplo n.º 2
0
 public virtual void Update()
 {
     ChangeSizeBorder();
     Move();
     ChangeSizeWindow();
     if (isRotate)
     {
         Rect rect = UIScreenTool.UIToScreenRect(canvas, currRect);
         transform.rotation = new Quaternion((rect.y + rect.height / 2 - 0.5f) / 4, (rect.x + rect.width / 2 - 0.5f) / 2, 0, 1);
     }
 }