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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions SingularSDK/Runtime/SingularSDK.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class SingularSDK : MonoBehaviour
#endregion

// The Singular SDK is initialized here
void Awake()
private void Awake()
{
// init logger - matches native layer logging levels
SingularUnityLogger.EnableLogging(enableLogging);
Expand Down Expand Up @@ -131,6 +131,9 @@ public static void InitializeSingularSDK()
if (Initialized)
return;

if (Application.isEditor)
return;

if (!instance)
{
SingularUnityLogger.LogError("SingularSDK InitializeSingularSDK, no instance available - cannot initialize");
Expand All @@ -139,11 +142,6 @@ public static void InitializeSingularSDK()

SingularUnityLogger.LogDebug(string.Format("SingularSDK InitializeSingularSDK, APIKey={0}", instance.SingularAPIKey));

if (Application.isEditor)
{
return;
}

SingularConfig config = BuildSingularConfig();

#if UNITY_IOS
Expand Down Expand Up @@ -206,10 +204,6 @@ private static SingularConfig BuildSingularConfig()
return config;
}

public void Update()
{
}

#if UNITY_ANDROID
private static void initSDK(SingularConfig config) {
SingularUnityLogger.LogDebug("UNITY_ANDROID - init Is called");
Expand Down Expand Up @@ -839,7 +833,7 @@ public static void SetAllowAutoIAPComplete(bool allowed)
#endif
}

void OnApplicationPause(bool paused)
private void OnApplicationPause(bool paused)
{
if (!Initialized || !instance)
return;
Expand All @@ -861,7 +855,7 @@ void OnApplicationPause(bool paused)
#endif
}

void OnApplicationQuit()
private void OnApplicationQuit()
{
if (Application.isEditor)
{
Expand Down