Playvoi/Assets/ShiroginSDK/Runtime/Core/SDK/ShiroginConfig.cs
2025-10-30 22:48:16 +03:00

99 lines
No EOL
3.8 KiB
C#

using ShiroginSDK.Runtime.Core.Editor.Attributes;
using ShiroginSDK.Runtime.Core.Editor.Models;
using ShiroginSDK.Runtime.Modules.Data.Scripts.Icons;
using ShiroginSDK.Runtime.Modules.IAP.Scripts.SO;
using ShiroginSDK.Runtime.Modules.RemoteConfig.Scripts.SO;
using ShiroginSDK.Runtime.Modules.UI.Popup.Scripts.SO;
using ShiroginSDK.Runtime.Modules.UI.Theme.Scripts.SO;
using ShiroginSDK.Runtime.Shared.Constants;
using UnityEngine;
namespace ShiroginSDK.Runtime.Core.SDK
{
[CreateAssetMenu(fileName = "ShiroginConfig", menuName = "ShiroginSDK/ShiroginConfig", order = 0)]
public class ShiroginConfig : ScriptableObject
{
private static ShiroginConfig _instance;
// ------------------------------------------------------------
// Original fields (unchanged)
// ------------------------------------------------------------
[Header("AppLovin Settings")]
public string applovinSdkKey;
[SubHeader("Android Ad Units")]
public string rewardedAdUnitIdDrd;
public string interstitialAdUnitIdDrd;
public string bannerAdUnitIdDrd;
[SubHeader("iOS Ad Units")]
public string rewardedAdUnitIdIos;
public string interstitialAdUnitIdIos;
public string bannerAdUnitIdIos;
[Header("Analytics Settings")] [Tooltip("Enable or disable Firebase Analytics globally.")]
public bool enableFirebaseAnalytics = true;
[Tooltip("Enable or disable Facebook Analytics globally.")]
public bool enableFacebookAnalytics = true;
[Tooltip("Enable or disable AppsFlyer Analytics globally.")]
public bool enableAppsFlyerAnalytics = true;
[Header("AppsFlyer Settings")]
public string appsFlyerDevKey;
[Tooltip("This is Apple app id (Only numbers)")]
public string appsFlyerAppId;
[Header("Repositories")] [Tooltip("All IAP and store products managed from here")]
public StoreRepository storeRepository;
[Tooltip("All Theme information managed from here")]
public ThemeRepository themeRepository;
[Tooltip("All Popup information managed from here")]
public PopupRepository popupRepository;
[Header("Remote Config")] [Tooltip("Enable or disable Firebase RemoteConfig globally.")]
public bool enableFirebaseRemoteConfig = true;
[Tooltip("Select which Firebase Remote Config group this game should use (e.g., DizzyHero, MoneyRoller, etc.)")]
public string selectedRemoteGroup = "DefaultGroup";
[Tooltip("Link to the RemoteConfigDefinition asset for editor preview/export")]
public RemoteConfigDefinition remoteConfigDefinition;
[Header("UI / Visual Settings")] [Tooltip("Icon set for all in-game currencies (Gems, Gold, etc.)")]
public CurrencyIconLibrary currencyIconLibrary;
[Header("Developer Settings")]
[SubHeader("AppLovin Settings")]
[Tooltip("AppLovin Test Devices (AID-IDFA) list for testing")]
public TestDevice[] applovinTestDevices;
/// <summary>
/// Loads the SDK configuration from Resources folder.
/// Looks for: Resources/ShiroginConfig.asset
/// </summary>
public static ShiroginConfig Load()
{
if (_instance != null)
return _instance;
_instance = Resources.Load<ShiroginConfig>(SDKConstants.ConfigResourcePath);
if (_instance == null)
Debug.LogError("[ShiroginSDK] ❌ SDKConfig asset not found! " +
"Please create 'ShiroginConfig.asset' inside a Resources folder.\n" +
"Path: Assets/ShiroginSDK/Resources/ShiroginConfig.asset");
else
Debug.Log("[ShiroginSDK] ✅ SDKConfig loaded successfully from Resources.");
return _instance;
}
}
}