示例#1
0
 public override void Update()
 {
     if (anchorUpdate == LYXAnchorUpdate.OnUpdate)
     {
         Vector2 vect = LCSCompHelper.SceneWidthAndHeight();
         mSceneWidth  = (int)vect.x;
         mSceneHeight = (int)vect.y;
         AdaptiveScene();
     }
 }
示例#2
0
        public override void Awake()
        {
            transform.localScale = Vector3.one;
            anchorWidget         = gameObject.GetComponent <UIWidget>();
            bool    isWidget = anchorWidget != null;
            Vector2 vect     = LCSCompHelper.SceneWidthAndHeight();

            mSceneWidth  = (int)vect.x;
            mSceneHeight = (int)vect.y;
            if (isWidget)
            {
                anchorWidget.ResetAnchors();
                mOriginalWidth  = anchorWidget.localSize.x;
                mOriginalHeight = anchorWidget.localSize.y;
            }
            else
            {
                // 1024 - 15
                // 768 - 11
                mOriginalWidth  = 15 / 1024f;
                mOriginalHeight = 11 / 768f;
            }
        }