Exemple #1
0
 protected override void CustomOnGUI()
 {
     _cachePhone = _phoneState;
     _phoneState = EnumPopup <ScreenResizeManager.PhoneState>("型号", _phoneState);
     if (_cachePhone != _phoneState)
     {
         ScreenResizeManager.SetPhoneVersion(_phoneState);
     }
     Space();
     _cacheOrientation  = _screenOrientation;
     _screenOrientation = EnumPopup <ScreenOrientation>("朝向", _screenOrientation);
     if (_cacheOrientation != _screenOrientation)
     {
         ScreenResizeManager.SetPhoneOrientation(_screenOrientation);
     }
 }
    void OnGUI()
    {
        _cachePhone = _phoneState;
        _phoneState = EnumPopup <ScreenResizeManager.PhoneState>("手机型号", _phoneState);
        if (_cachePhone != _phoneState)
        {
            ScreenResizeManager.SetPhoneState(_phoneState);
        }

        EditorGUILayout.Space();
        _cacheOrientation  = _screenOrientation;
        _screenOrientation = EnumPopup <ScreenOrientation>("朝向", _screenOrientation);
        if (_cacheOrientation != _screenOrientation)
        {
            ScreenResizeManager.SetScreenOrientation(_screenOrientation);
        }
    }
 private void Awake()
 {
     _screenOrientation = ScreenResizeManager.GetScreenOrientation();
     _phoneState        = ScreenResizeManager.GetPhoneState();
 }