protected void OnEnable()
        {
            _cameraIcon       = EditorUtil.GetCameraIcon();
            _configsIcon      = EditorUtil.GetConfigsIcon();
            _folderIcon       = EditorUtil.GetFolderIcon();
            _takeButtonNormal = EditorUtil.GetButtonNormalTexture();
            _takeButtonActive = EditorUtil.GetButtonActiveTexture();
            _takeButtonIcon   = EditorUtil.GetScreenshotsIcon();

            // Reset button style, bcz it can be initialized only on GUI section
            _buttonStyle = null;

            _settings = ScreenShooterSettings.Load();

            // Init reorderable list if required
            _list = _list ?? ReorderableConfigsList.Create(_settings.ScreenshotConfigs, MenuItemHandler);
        }
示例#2
0
        protected void OnEnable()
        {
            var skinFolder = (EditorGUIUtility.isProSkin) ? "Professional/" : "Personal/";

            _cameraIcon  = (Texture2D)EditorGUIUtility.Load(ICONS_FOLDER + skinFolder + "CameraIcon.png");
            _configsIcon = (Texture2D)EditorGUIUtility.Load(ICONS_FOLDER + skinFolder + "ConfigsIcon.png");
            _folderIcon  = (Texture2D)EditorGUIUtility.Load(ICONS_FOLDER + skinFolder + "FolderIcon.png");

            _takeButtonNormal = (Texture2D)EditorGUIUtility.Load(ICONS_FOLDER + skinFolder + "TakeButtonNormal.png");
            _takeButtonActive = (Texture2D)EditorGUIUtility.Load(ICONS_FOLDER + skinFolder + "TakeButtonActive.png");
            _takeButtonIcon   = (Texture2D)EditorGUIUtility.Load(ICONS_FOLDER + "TakeScreenshotsIcon.png");
            // Reset button style, bcz it can be initialized only on GUI section
            _buttonStyle = null;

            _settings = ScreenShooterSettings.Load();

            // Init reorderable list if required
            _list = _list ?? ReorderableConfigsList.Create(_settings.ScreenshotConfigs, MenuItemHandler);
        }
        /*[MenuItem("Window/Editor Screen Shooter/Take Screenshots &#s")]
         * private static void TakeScreenshotOnHotkey()
         * {
         *  EditorCoroutine.Start(TakeScreenshots());
         * }*/

        protected void OnEnable()
        {
            _cameraIcon       = EditorUtil.GetCameraIcon();
            _configsIcon      = EditorUtil.GetConfigsIcon();
            _folderIcon       = EditorUtil.GetFolderIcon();
            _takeButtonNormal = EditorUtil.GetButtonNormalTexture();
            _takeButtonActive = EditorUtil.GetButtonActiveTexture();
            _takeButtonIcon   = EditorUtil.GetScreenshotsIcon();

            // Reset button style, bcz it can be initialized only on GUI section
            _buttonStyle = null;

            // Init reorderable list if required
            _list = _list ?? ReorderableConfigsList.Create(ScreenShooterSettings.Instance.ScreenshotConfigs, MenuItemHandler);

            _camerasList = new UnityEditorInternal.ReorderableList(ScreenShooterSettings.Instance.Cameras, typeof(Camera), true, false, true, true);
            _camerasList.headerHeight         = 0;
            _camerasList.drawElementCallback += (Rect rect, int index, bool isActive, bool isFocused) =>
            {
                _camerasList.list[index] = EditorGUI.ObjectField(rect, _camerasList.list[index] as Camera, typeof(Camera), true);
            };
        }