Example #1
0
        private void Awake()
        {
            _panel = GetComponent <RectTransform>();

            if (_panel == null)
            {
                Debug.LogError($"Cannot find rect component, screen safe panel not enabled for {gameObject.name}");
                return;
            }

            ScreenSafePanelHandler.AddPanel(this);
        }
Example #2
0
        private void Awake()
        {
            if (_instance != null)
            {
                Destroy(gameObject);
                return;
            }

            _instance = this;


#if UNITY_EDITOR
            //Get custom safe area handler such as for testing
            _safeAreaHandler = GetComponent <ISafeAreaHandler>() ?? new SafeAreaHandler();
#else
            _safeAreaHandler = new SafeAreaHandler();
#endif
        }