Esempio n. 1
0
        public void Resize()
        {
            RectTransform component = GetComponent <RectTransform>();
            Vector2       anchorMax = component.anchorMax;

            if (TweakerConsoleController.IsLandscape())
            {
                anchorMax.x = 0.5f;
            }
            else
            {
                anchorMax.x = 1f;
            }
            component.anchorMax = anchorMax;
        }
Esempio n. 2
0
 private void CalculateGridSize()
 {
     if (TweakerConsoleController.IsLandscape())
     {
         gridHeight = targetGridSize;
         float num  = (float)Screen.height / ((float)gridHeight + 1f);
         float num2 = num / (Mathf.Sqrt(3f) / 2f);
         float num3 = num2 * 0.75f;
         gridWidth = (uint)(((float)Screen.width - num2 / 4f) / num3);
     }
     else
     {
         gridWidth = targetGridSize;
         float num2 = (float)Screen.width / (float)gridWidth;
         num2 *= 1.25f;
         float num = num2 * (Mathf.Sqrt(3f) / 2f);
         gridHeight = (uint)((float)Screen.height / num);
     }
 }