Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Application.isEditor check order in InitializeSingularSDK in editor #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

VsIG-official
Copy link

@VsIG-official VsIG-official commented Sep 27, 2024

Description

1. Awake and InitializeSingularSDK initialization flow order in editor

While initializing SingularSDK via InitializeSingularSDK in the Unity Editor I've encountered error SingularSDK InitializeSingularSDK, no instance available - cannot initialize.

It seems like strange behavior to Me because this error occurs when there's no SingularSDK instance, however, it's impossible for the instance to exist because there's a check in Awake before its creation to ensure, if We are in the editor, then return.

So in My PR I've changed Awake to be more like InitializeSingularSDK: firstly check if We're in the editor and then - if We have an instance of SingularSDK

Before fix:

  • Awake - if(Application.isEditor) -> if(instance)
  • InitializeSingularSDK - if(!instance) -> if(Application.isEditor)

After fix:

  • Awake - if(Application.isEditor) -> if(instance)
  • InitializeSingularSDK - if(Application.isEditor) -> if(!instance)

Commit

2. Private keywords, whitespaces and unused methods

Also I've added private keywords to Unity methods and deleted some whitespaces + unused Update method

Commit 'whitespaces and unused methods'

Commit 'access keywords'

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