Skip to content

Commit

Permalink
Merge pull request #21 from wolf-org/dev
Browse files Browse the repository at this point in the history
- fix debug.log
  • Loading branch information
VirtueSky authored Oct 22, 2024
2 parents 183153b + 00927b1 commit 1eec2e3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
3 changes: 2 additions & 1 deletion Module/Advertising/Runtime/General/Advertising.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#endif
using UnityEngine;
using VirtueSky.Inspector;
using VirtueSky.Misc;

namespace VirtueSky.Ads
{
Expand Down Expand Up @@ -95,7 +96,7 @@ void InitAdClient()

currentAdClient.SetupAdSettings(adSettings);
currentAdClient.Initialize();
Debug.Log("currentAdClient: " + currentAdClient);
Debug.Log($"currentAdClient: {currentAdClient}".SetColor(Color.cyan));
isInitAdClient = true;
InitAutoLoadAds();
}
Expand Down
7 changes: 4 additions & 3 deletions Module/RemoteConfig/Runtime/FirebaseRemoteConfigData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using UnityEngine;
using VirtueSky.DataStorage;
using VirtueSky.Inspector;
using VirtueSky.Misc;

namespace VirtueSky.RemoteConfigs
{
Expand Down Expand Up @@ -62,7 +63,7 @@ public void SetupData(ConfigValue result)
}

resultValueString = GameData.Get<string>(key);
Debug.Log($"<color=Green>{key}: {resultValueString}</color>");
Debug.Log($"{key}: {resultValueString}".SetColor(Color.green));
break;
case TypeRemoteConfigData.BooleanData:
if (result.Source == ValueSource.RemoteValue)
Expand All @@ -71,7 +72,7 @@ public void SetupData(ConfigValue result)
}

resultValueBool = GameData.Get<bool>(key);
Debug.Log($"<color=Green>{key}: {resultValueBool}</color>");
Debug.Log($"{key}: {resultValueBool}".SetColor(Color.green));
break;
case TypeRemoteConfigData.IntData:
if (result.Source == ValueSource.RemoteValue)
Expand All @@ -80,7 +81,7 @@ public void SetupData(ConfigValue result)
}

resultValueInt = GameData.Get<int>(key);
Debug.Log($"<color=Green>{key}: {resultValueInt}</color>");
Debug.Log($"{key}: {resultValueInt}".SetColor(Color.green));
break;
}
}
Expand Down
27 changes: 8 additions & 19 deletions Module/RemoteConfig/Runtime/FirebaseRemoteConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using UnityEngine;
using VirtueSky.Core;
using VirtueSky.Inspector;
using VirtueSky.Misc;
using VirtueSky.Utils;

#if UNITY_EDITOR
using VirtueSky.UtilsEditor;
Expand Down Expand Up @@ -42,7 +44,7 @@ public static bool FirebaseDependencyAvailable
get
{
#if VIRTUESKY_FIREBASE
return ins.dependencyStatus == DependencyStatus.Available;
return ins.dependencyStatus == DependencyStatus.Available;
#else
return false;
#endif
Expand Down Expand Up @@ -103,8 +105,7 @@ private void Init()
}
else
{
Debug.LogError("Could not resolve all Firebase dependencies: " +
dependencyStatus);
Debug.LogError($"Could not resolve all Firebase dependencies: {dependencyStatus}".SetColor(Color.red));
}
});
#endif
Expand All @@ -113,21 +114,9 @@ private void Init()
#if VIRTUESKY_FIREBASE_REMOTECONFIG && VIRTUESKY_FIREBASE
public Task FetchDataAsync()
{
Debug.Log("Fetching data...");
Debug.Log("Fetching data...".SetColor(CustomColor.Cyan));
Task fetchTask = FirebaseRemoteConfig.DefaultInstance
.FetchAsync(TimeSpan.Zero);
if (fetchTask.IsCanceled)
{
Debug.Log("Fetch canceled.");
}
else if (fetchTask.IsFaulted)
{
Debug.Log("Fetch encountered an error.");
}
else if (fetchTask.IsCompleted)
{
Debug.Log("Fetch completed successfully!");
}

return fetchTask.ContinueWithOnMainThread(tast =>
{
Expand All @@ -138,7 +127,7 @@ public Task FetchDataAsync()
task =>
{
Debug.Log(String.Format(
"Remote data loaded and ready (last fetch time {0}).",
"Remote data loaded and ready (last fetch time {0}).".SetColor(CustomColor.Cyan),
info.FetchTime));
foreach (var remoteConfigData in listRemoteConfigData)
{
Expand All @@ -150,11 +139,11 @@ public Task FetchDataAsync()
isFetchRemoteConfigCompleted = true;
});

Debug.Log("<color=Green>Firebase Remote Config Fetching completed!</color>");
Debug.Log("Firebase Remote Config Fetching completed!".SetColor(Color.green));
}
else
{
Debug.Log("Fetching data did not completed!");
Debug.Log("Fetching data did not completed!".SetColor(Color.red));
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"GUID:324caed91501a9c47a04ebfd87b68794",
"GUID:ba00a69c89ab3a94d84d27e0051afcfd",
"GUID:32dbaa332e571bf429b7de517f75f074",
"GUID:b59f3d97c7580944baac8dafbd217904"
"GUID:b59f3d97c7580944baac8dafbd217904",
"GUID:fca7ec166e04dc948b624a983315e2c9",
"GUID:d25c81a6e03d11c4fb58d263c8aaea84"
],
"includePlatforms": [],
"excludePlatforms": [],
Expand Down

0 comments on commit 1eec2e3

Please sign in to comment.