Skip to content

Persist FPS slider and Enter Play Mode dropdown across editor restarts#39

Open
alperunlu07 wants to merge 1 commit into
smkplus:masterfrom
alperunlu07:fix/persist-toolbar-element-state
Open

Persist FPS slider and Enter Play Mode dropdown across editor restarts#39
alperunlu07 wants to merge 1 commit into
smkplus:masterfrom
alperunlu07:fix/persist-toolbar-element-state

Conversation

@alperunlu07

Copy link
Copy Markdown

ToolbarFPSSlider:

  • Mark selectedFramerate [SerializeField] (default 60) so the chosen value survives domain reload / editor restart.
  • Replace global GUI.changed with EditorGUI.BeginChangeCheck/EndChangeCheck to avoid reacting to unrelated GUI events.
  • Save() the toolbar setting on change so toolbar-side edits are persisted even when the Project Settings panel is not open.

ToolbarEnterPlayMode:

  • Mark selectedEnterPlayMode [SerializeField] as a defensive cache.
  • Lazy-init enterPlayModeOption labels in OnDrawInToolbar in case the initializer hasn't run yet.
  • Apply selection to EditorSettings via a dedicated helper, called both on Init() and on user change, so the saved value is enforced on editor open.
  • Switch to BeginChangeCheck/EndChangeCheck instead of GUI.changed.
  • Save() the toolbar setting on change.

ToolbarFPSSlider:
- Mark selectedFramerate [SerializeField] (default 60) so the chosen
  value survives domain reload / editor restart.
- Replace global GUI.changed with EditorGUI.BeginChangeCheck/EndChangeCheck
  to avoid reacting to unrelated GUI events.
- Save() the toolbar setting on change so toolbar-side edits are persisted
  even when the Project Settings panel is not open.

ToolbarEnterPlayMode:
- Mark selectedEnterPlayMode [SerializeField] as a defensive cache.
- Lazy-init enterPlayModeOption labels in OnDrawInToolbar in case the
  initializer hasn't run yet.
- Apply selection to EditorSettings via a dedicated helper, called both
  on Init() and on user change, so the saved value is enforced on
  editor open.
- Switch to BeginChangeCheck/EndChangeCheck instead of GUI.changed.
- Save() the toolbar setting on change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant