Skip to content

fix: Use PlayerPrefsStorageProvider on Nintendo Switch#48

Merged
charlesvien merged 1 commit intomainfrom
03-25-use_playerprefsstorageprovider_on_nintendo_switch
Mar 26, 2026
Merged

fix: Use PlayerPrefsStorageProvider on Nintendo Switch#48
charlesvien merged 1 commit intomainfrom
03-25-use_playerprefsstorageprovider_on_nintendo_switch

Conversation

@charlesvien
Copy link
Copy Markdown
Member

@charlesvien charlesvien commented Mar 25, 2026

💡 Motivation and Context

FileStorageProvider causes disk access errors on Nintendo Switch, preventing the SDK from initializing correctly.

💚 How did you test it?

Manually

📝 Checklist

  1. Add UNITY_SWITCH to the preprocessor guard in CreateStorageProvider
  2. Fall back to PlayerPrefsStorageProvider on Switch, matching WebGL behavior

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@charlesvien charlesvien changed the title Use PlayerPrefsStorageProvider on Nintendo Switch fix: Use PlayerPrefsStorageProvider on Nintendo Switch Mar 25, 2026
@charlesvien charlesvien marked this pull request as ready for review March 25, 2026 09:32
@haacked haacked requested a review from Copilot March 26, 2026 22:38
Copy link
Copy Markdown
Collaborator

@haacked haacked left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates platform-specific storage selection to avoid file I/O on Nintendo Switch, aligning Switch behavior with WebGL to prevent SDK initialization failures caused by disk access errors.

Changes:

  • Extend the storage-provider preprocessor guard to include UNITY_SWITCH.
  • Use PlayerPrefsStorageProvider on Nintendo Switch builds (outside the editor) instead of FileStorageProvider.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@charlesvien charlesvien merged commit 8980cce into main Mar 26, 2026
17 checks passed
@charlesvien charlesvien deleted the 03-25-use_playerprefsstorageprovider_on_nintendo_switch branch March 26, 2026 22:40
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.

3 participants