void SetupLetterbox()
        {
            var letterbox = ProCamera2D.gameObject.GetComponentInChildren <ProCamera2DLetterbox>();

            if (letterbox == null)
            {
                var cameras = ProCamera2D.gameObject.GetComponentsInChildren <Camera>();
                cameras = cameras.OrderByDescending(c => c.depth).ToArray();
                cameras[0].gameObject.AddComponent <ProCamera2DLetterbox>();
            }

            _letterbox = letterbox;
        }
 void SetupLetterbox()
 {
     var letterbox = ProCamera2D.gameObject.GetComponent<ProCamera2DLetterbox>();
     _letterbox = letterbox == null ? ProCamera2D.gameObject.AddComponent<ProCamera2DLetterbox>() : letterbox;
 }
Exemplo n.º 3
0
        void SetupLetterbox()
        {
            var letterbox = ProCamera2D.gameObject.GetComponent <ProCamera2DLetterbox>();

            _letterbox = letterbox == null?ProCamera2D.gameObject.AddComponent <ProCamera2DLetterbox>() : letterbox;
        }
Exemplo n.º 4
0
        void SetupLetterbox()
        {
            var letterbox = ProCamera2D.gameObject.GetComponentInChildren<ProCamera2DLetterbox>();

            if (letterbox == null)
            {
                var cameras = ProCamera2D.gameObject.GetComponentsInChildren<Camera>();
                cameras = cameras.OrderByDescending(c => c.depth).ToArray();
                cameras[0].gameObject.AddComponent<ProCamera2DLetterbox>();
            }

            _letterbox = letterbox;
        }