2025-09-04 06:24:18 +00:00
|
|
|
|
using System;
|
2025-08-30 10:46:34 +00:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
2026-01-22 06:45:35 +00:00
|
|
|
|
using System.Globalization;
|
2025-09-04 06:24:18 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2025-08-30 10:46:34 +00:00
|
|
|
|
using AdjustSdk;
|
2025-09-05 07:42:51 +00:00
|
|
|
|
using ThinkingData.Analytics;
|
2025-08-30 10:46:34 +00:00
|
|
|
|
using UnityEngine;
|
2025-09-01 10:32:50 +00:00
|
|
|
|
using WZ;
|
2025-08-30 10:46:34 +00:00
|
|
|
|
|
2025-09-02 09:14:49 +00:00
|
|
|
|
public class AdjustManager : D_MonoSingleton<AdjustManager>
|
2025-08-30 10:46:34 +00:00
|
|
|
|
{
|
2025-09-04 06:24:18 +00:00
|
|
|
|
private AdjustEnvironment environment = AdjustEnvironment.Production;
|
2025-08-30 10:46:34 +00:00
|
|
|
|
|
2026-01-22 06:45:35 +00:00
|
|
|
|
private const string KEY_FIRST_INIT_ADJUST = "FIRST_INIT_ADJUST";
|
|
|
|
|
|
private const string KEY_ADJUST_INIT_COUNT = "ADJUST_INIT_COUNT";
|
|
|
|
|
|
|
2025-09-02 03:45:05 +00:00
|
|
|
|
private long startTime = 0;
|
2025-09-02 09:36:19 +00:00
|
|
|
|
private string Adid;
|
|
|
|
|
|
private string Gdid;
|
2025-09-04 06:24:18 +00:00
|
|
|
|
private string callbackNetwork = "";
|
|
|
|
|
|
bool m_start = false;
|
|
|
|
|
|
private int callGetTimes = 0;
|
2025-09-18 10:30:57 +00:00
|
|
|
|
private string _adjustNetwork = "_adjustNetwork";
|
|
|
|
|
|
private string _adjustCampaign = "_adjustCampaign";
|
|
|
|
|
|
private string _adjustAdgroup = "_adjustAdgroup";
|
|
|
|
|
|
private string _adjustCreative = "_adjustCreative";
|
|
|
|
|
|
private string _adjustClickLabel = "_adjustClickLabel";
|
2025-09-10 09:52:33 +00:00
|
|
|
|
|
2026-01-22 06:45:35 +00:00
|
|
|
|
private int adjnitialization;
|
|
|
|
|
|
private decimal conditionsCount;
|
|
|
|
|
|
private decimal curConditionsCount = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 之前已经初始化过Adjust,之后启动游戏可以直接初始化
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void GameStarInit()
|
|
|
|
|
|
{
|
|
|
|
|
|
string netWork = AdjustNetwork.GetNetwork();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(netWork))
|
|
|
|
|
|
{
|
|
|
|
|
|
LoggerUtils.Debug("归因信息有缓存,直接初始化");
|
|
|
|
|
|
InitAdjust();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IEnumerator DelayInit()
|
|
|
|
|
|
{
|
|
|
|
|
|
int time = RushSDKManager.Instance.GetRemoteConfigInt("Adjust_Times", 30);
|
|
|
|
|
|
if (conditionsCount > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
yield return new WaitForSeconds(time);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UpdateConditionsCount(AdjustInitTiming.OpenGameTime);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// TODO:在查询订单状态成功后调用: AdjustManager.Instance.UpdateConditionsCount(AdjustInitTiming.COSuccessTime);
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void UpdateConditionsCount(AdjustInitTiming timing, decimal count = 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
//条件不匹配
|
|
|
|
|
|
if(adjnitialization != (int)timing) return;
|
|
|
|
|
|
//已经初始化过了
|
|
|
|
|
|
if(startTime != 0) return;
|
|
|
|
|
|
|
|
|
|
|
|
if (conditionsCount == 1 && timing != AdjustInitTiming.AdRevenue)
|
|
|
|
|
|
{
|
|
|
|
|
|
//初始化
|
|
|
|
|
|
InitAdjust();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
InitCurConditionsCount();
|
|
|
|
|
|
//累计数量
|
|
|
|
|
|
UpdateCurConditionsCount(count);
|
|
|
|
|
|
LoggerUtils.Debug($"当前条件:{timing.ToString()}, 目标次数{conditionsCount},当前次数{curConditionsCount}");
|
|
|
|
|
|
|
|
|
|
|
|
if (curConditionsCount >= conditionsCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
LoggerUtils.Debug("满足条件,初始化");
|
|
|
|
|
|
InitAdjust();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 初始化Adjust
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void InitAdjust()
|
2025-08-30 10:46:34 +00:00
|
|
|
|
{
|
2026-01-22 06:45:35 +00:00
|
|
|
|
if (!CanInitAdjust())
|
|
|
|
|
|
{
|
|
|
|
|
|
LoggerUtils.Debug("Adjust_Geting在线参数不是1,不能初始化");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-02 03:45:05 +00:00
|
|
|
|
//开始计时
|
|
|
|
|
|
startTime = TimeUtils.GetLocalTimestamp();
|
2025-09-05 07:42:51 +00:00
|
|
|
|
Adjust.AddGlobalCallbackParameter("ta_distinct_id", TDAnalytics.GetDistinctId());
|
2025-09-18 03:25:52 +00:00
|
|
|
|
|
|
|
|
|
|
Adjust.AddGlobalCallbackParameter("rush_version", RushSDKManager.GetSDKVersion());
|
|
|
|
|
|
Adjust.AddGlobalPartnerParameter("rush_version", RushSDKManager.GetSDKVersion());
|
2025-09-18 10:30:57 +00:00
|
|
|
|
|
2025-09-02 09:50:19 +00:00
|
|
|
|
AdjustConfig config = new AdjustConfig(StaticValue.AdjustToken, environment);
|
2025-09-03 03:45:52 +00:00
|
|
|
|
|
2025-08-30 10:46:34 +00:00
|
|
|
|
// 设置归因变更回调函数
|
|
|
|
|
|
config.AttributionChangedDelegate = AttributionChangedDelegate;
|
2025-09-03 03:45:52 +00:00
|
|
|
|
|
2025-08-30 10:46:34 +00:00
|
|
|
|
// (可选)设置其他配置,如日志级别
|
|
|
|
|
|
config.LogLevel = AdjustLogLevel.Verbose;
|
2025-09-03 03:45:52 +00:00
|
|
|
|
|
2025-08-30 10:46:34 +00:00
|
|
|
|
// 初始化Adjust SDK
|
2026-01-22 06:45:35 +00:00
|
|
|
|
LoggerUtils.Debug("Adjust初始化");
|
2025-08-30 10:46:34 +00:00
|
|
|
|
Adjust.InitSdk(config);
|
2026-01-22 06:45:35 +00:00
|
|
|
|
|
2025-09-02 09:36:19 +00:00
|
|
|
|
//id
|
|
|
|
|
|
LoadAdid();
|
|
|
|
|
|
LoadGaid();
|
2025-09-03 03:45:52 +00:00
|
|
|
|
|
2025-09-02 03:45:05 +00:00
|
|
|
|
ShuShuEvent.Instance.Track("adjust_init");
|
|
|
|
|
|
FireBaseAnalyticsManager.Instance.LogEvent("adjust_init");
|
2025-09-15 10:37:40 +00:00
|
|
|
|
Adjust.GetAdid((id) =>
|
2025-09-10 09:52:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
ShuShuEvent.Instance.SetSuperProperties(new Dictionary<string, object>() { { "adid", id } });
|
|
|
|
|
|
ShuShuEvent.Instance.UserSet(new Dictionary<string, object>() { { "adid", id } });
|
|
|
|
|
|
});
|
2025-09-15 10:37:40 +00:00
|
|
|
|
|
|
|
|
|
|
var network = AdjustNetwork.GetNetwork();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(network))
|
2025-09-18 10:30:57 +00:00
|
|
|
|
{
|
2025-09-15 10:37:40 +00:00
|
|
|
|
RushSDKManager.Instance.OnUserSourceListener?.Invoke(IsOrganic(network), network);
|
2025-09-18 10:30:57 +00:00
|
|
|
|
}
|
2025-08-30 10:46:34 +00:00
|
|
|
|
}
|
2025-09-03 03:45:52 +00:00
|
|
|
|
|
2026-01-22 06:45:35 +00:00
|
|
|
|
public void InitConfig()
|
|
|
|
|
|
{
|
|
|
|
|
|
adjnitialization = RushSDKManager.Instance.GetRemoteConfigInt("Adjinitialization", 0);
|
2025-09-04 06:24:18 +00:00
|
|
|
|
|
2026-01-22 06:45:35 +00:00
|
|
|
|
if (adjnitialization == (int)AdjustInitTiming.ShowAdTime)
|
|
|
|
|
|
{
|
|
|
|
|
|
conditionsCount = RushSDKManager.Instance.GetRemoteConfigInt("SHOW_AD_NUM", 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (adjnitialization == (int)AdjustInitTiming.AdRevenue)
|
|
|
|
|
|
{
|
|
|
|
|
|
conditionsCount = (decimal)RushSDKManager.Instance.GetRemoteConfigFloat("SHOW_AD_REVENUE", 0.005f);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (adjnitialization == (int)AdjustInitTiming.COSuccessTime)
|
|
|
|
|
|
{
|
|
|
|
|
|
conditionsCount = RushSDKManager.Instance.GetRemoteConfigInt("CASH_OUT_NUM", 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
conditionsCount = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-30 10:46:34 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 归因信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="attribution"></param>
|
2025-09-03 03:45:52 +00:00
|
|
|
|
private void AttributionChangedDelegate(AdjustAttribution attribution)
|
2025-08-30 10:46:34 +00:00
|
|
|
|
{
|
2025-09-03 03:45:52 +00:00
|
|
|
|
Debug.Log("Attribution changed network: " + attribution.Network + " campaign: " + attribution.Campaign + " adgroup: " + attribution.Adgroup + " creative: " + attribution.Creative);
|
2025-09-04 06:24:18 +00:00
|
|
|
|
if (m_start) return;
|
|
|
|
|
|
m_start = true;
|
|
|
|
|
|
callbackNetwork = attribution.Network;
|
|
|
|
|
|
if (IsOrganic(attribution.Network) == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
OnReceiveCallback(attribution);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
InvokeRepeating(nameof(CallGetAttributionAsync), 0, 1);
|
2025-09-03 03:45:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-04 06:24:18 +00:00
|
|
|
|
private async Task CallGetAttributionAsync()
|
2025-09-03 03:45:52 +00:00
|
|
|
|
{
|
2025-09-04 06:24:18 +00:00
|
|
|
|
callGetTimes++;
|
2025-09-03 03:45:52 +00:00
|
|
|
|
|
2025-09-04 06:24:18 +00:00
|
|
|
|
AdjustAttribution attribute = await GetAttributionAsync();
|
|
|
|
|
|
LoggerUtils.Debug("[adjust] adjust CallGetAttribution callGetTimes : " + callGetTimes + " attinfo:" + attribute.Network + " clicklabel:" + attribute.ClickLabel);
|
|
|
|
|
|
if (attribute != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
LoggerUtils.Debug("[adjust] adjust 重试次数 : " + callGetTimes + ", attribute : " + attribute.Network + ", callbackNetwork : " + callbackNetwork);
|
|
|
|
|
|
if (attribute.Network.Equals(callbackNetwork) == false)
|
|
|
|
|
|
{
|
|
|
|
|
|
CancelInvoke(nameof(CallGetAttributionAsync));
|
|
|
|
|
|
OnReceiveCallback(attribute);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (callGetTimes >= 3*60)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (attribute != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
OnReceiveCallback(attribute);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
OnReceiveCallback(null);
|
|
|
|
|
|
}
|
|
|
|
|
|
CancelInvoke(nameof(CallGetAttributionAsync));
|
|
|
|
|
|
}
|
2025-09-03 03:45:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-04 06:24:18 +00:00
|
|
|
|
public static Task<AdjustAttribution> GetAttributionAsync()
|
2025-09-03 03:45:52 +00:00
|
|
|
|
{
|
2025-09-04 06:24:18 +00:00
|
|
|
|
var tcs = new TaskCompletionSource<AdjustAttribution>();
|
|
|
|
|
|
|
|
|
|
|
|
Adjust.GetAttribution(attribution =>
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
tcs.TrySetResult(attribution);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
tcs.TrySetException(ex);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return tcs.Task;
|
2025-09-03 03:45:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-04 06:24:18 +00:00
|
|
|
|
private void OnReceiveCallback(AdjustAttribution attribution)
|
2025-09-03 03:45:52 +00:00
|
|
|
|
{
|
2025-09-04 06:24:18 +00:00
|
|
|
|
string campaign = "";
|
|
|
|
|
|
string adgroup = "";
|
|
|
|
|
|
string creative = "";
|
|
|
|
|
|
string network = "";
|
|
|
|
|
|
|
|
|
|
|
|
if (attribution != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
campaign = attribution.Campaign;
|
|
|
|
|
|
adgroup = attribution.Adgroup;
|
|
|
|
|
|
creative = attribution.Creative;
|
2025-09-15 10:37:40 +00:00
|
|
|
|
|
2025-09-09 11:50:18 +00:00
|
|
|
|
if (!string.IsNullOrEmpty(attribution.Network))
|
|
|
|
|
|
{
|
|
|
|
|
|
network = attribution.Network;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
network = "Organic";
|
|
|
|
|
|
}
|
2025-09-04 06:24:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
2025-09-15 10:37:40 +00:00
|
|
|
|
{
|
2025-09-04 06:24:18 +00:00
|
|
|
|
network = "Organic";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AdjustNetwork.Instance.SetNetwork(attribution.Network);
|
2025-11-07 08:23:55 +00:00
|
|
|
|
RushSDKManager.Instance.OnUserSourceListener?.Invoke(IsOrganic(network), network);
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsString(_adjustNetwork, network);
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsString(_adjustCampaign, campaign);
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsString(_adjustAdgroup, adgroup);
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsString(_adjustCreative, creative);
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsString(_adjustClickLabel, attribution?.ClickLabel);
|
2025-09-04 06:24:18 +00:00
|
|
|
|
ShuShuEvent.Instance.UserSet(new Dictionary<string, object>
|
|
|
|
|
|
{
|
|
|
|
|
|
{ "user_ad_network", network ?? "" },
|
|
|
|
|
|
{ "user_campaign", campaign ?? "" },
|
|
|
|
|
|
{ "user_adgroup", adgroup ?? "" },
|
|
|
|
|
|
{ "user_creative", creative ?? "" },
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2025-09-08 05:37:51 +00:00
|
|
|
|
RushSDKManager.Instance.SetSuperProperties(new Dictionary<string, object>
|
2025-09-04 06:24:18 +00:00
|
|
|
|
{
|
|
|
|
|
|
{ "ad_network", network ?? "" },
|
|
|
|
|
|
{ "campaign", campaign ?? "" },
|
|
|
|
|
|
{ "adgroup", adgroup ?? "" },
|
|
|
|
|
|
{ "creative", creative ?? "" },
|
|
|
|
|
|
});
|
2025-11-07 08:23:55 +00:00
|
|
|
|
AdjustNetwork.Instance.LogEventGetSuccess();
|
2025-09-03 03:45:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-18 10:30:57 +00:00
|
|
|
|
public string GetAdjustNetwork()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PlayerPrefsUtils.GetPlayerPrefsString(_adjustNetwork);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetAdjustCampaign()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PlayerPrefsUtils.GetPlayerPrefsString(_adjustCampaign);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetAdjustAdgroup()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PlayerPrefsUtils.GetPlayerPrefsString(_adjustAdgroup);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetAdjustCreative()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PlayerPrefsUtils.GetPlayerPrefsString(_adjustCreative);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetAdjustClickLabel()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PlayerPrefsUtils.GetPlayerPrefsString(_adjustClickLabel);
|
|
|
|
|
|
}
|
2025-09-04 06:24:18 +00:00
|
|
|
|
|
|
|
|
|
|
private bool IsOrganic(string _network)
|
2025-09-03 03:45:52 +00:00
|
|
|
|
{
|
2025-09-09 12:00:09 +00:00
|
|
|
|
if (string.IsNullOrEmpty(_network) || _network.Equals("Organic") || _network.Equals("Untrusted Devices"))
|
2025-09-04 06:24:18 +00:00
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
2025-08-30 10:46:34 +00:00
|
|
|
|
}
|
2025-09-02 03:45:05 +00:00
|
|
|
|
|
|
|
|
|
|
public long GetStartTime()
|
|
|
|
|
|
{
|
|
|
|
|
|
return startTime;
|
|
|
|
|
|
}
|
2025-08-30 10:46:34 +00:00
|
|
|
|
|
2025-09-02 09:36:19 +00:00
|
|
|
|
private void LoadGaid()
|
|
|
|
|
|
{
|
|
|
|
|
|
Adjust.GetGoogleAdId(googleAdId => {
|
|
|
|
|
|
Gdid = googleAdId;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetGdid()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Gdid;
|
|
|
|
|
|
}
|
2025-08-30 10:46:34 +00:00
|
|
|
|
|
2025-09-02 09:36:19 +00:00
|
|
|
|
private void LoadAdid()
|
|
|
|
|
|
{
|
|
|
|
|
|
Adjust.GetAdid(adid =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Adid = adid;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string GetAdid()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Adid;
|
|
|
|
|
|
}
|
2026-01-22 06:45:35 +00:00
|
|
|
|
|
|
|
|
|
|
private bool IsFirstInitAdjust()
|
|
|
|
|
|
{
|
|
|
|
|
|
return PlayerPrefsUtils.GetPlayerPrefsInt(KEY_FIRST_INIT_ADJUST, 0) == 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateInitAdjustCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsInt(KEY_FIRST_INIT_ADJUST, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool CanInitAdjust()
|
|
|
|
|
|
{
|
|
|
|
|
|
//判断之前有没有初始化成功过
|
|
|
|
|
|
string netWork = AdjustNetwork.GetNetwork();
|
|
|
|
|
|
if (!string.IsNullOrEmpty(netWork))
|
|
|
|
|
|
{
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//判断开关是不是1
|
|
|
|
|
|
int adjustGeting = RushSDKManager.Instance.GetRemoteConfigInt("Adjust_Geting", 0);
|
|
|
|
|
|
if (IsFirstInitAdjust())
|
|
|
|
|
|
{
|
|
|
|
|
|
UpdateInitAdjustCount();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
return adjustGeting == 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void InitCurConditionsCount()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (curConditionsCount == -1)
|
|
|
|
|
|
{
|
|
|
|
|
|
string curConditionsCountStr = PlayerPrefsUtils.GetPlayerPrefsString(KEY_ADJUST_INIT_COUNT);
|
|
|
|
|
|
curConditionsCount = string.IsNullOrEmpty(curConditionsCountStr) ? 0 : decimal.Parse(curConditionsCountStr);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void UpdateCurConditionsCount(decimal count)
|
|
|
|
|
|
{
|
|
|
|
|
|
curConditionsCount += count;
|
|
|
|
|
|
PlayerPrefsUtils.SavePlayerPrefsString(KEY_ADJUST_INIT_COUNT, curConditionsCount.ToString(CultureInfo.InvariantCulture));
|
|
|
|
|
|
}
|
2025-08-30 10:46:34 +00:00
|
|
|
|
}
|