blob: 35212f62bf39c365876721442805545e9a9be153 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
using System;
using System.Collections;
using UnityEngine;
public class AdDataCollectScreen : MonoBehaviour
{
public ToggleButtonBehaviour PersonalizedAdsButton;
private void Start()
{
this.UpdateButtons();
}
public IEnumerator Show()
{
if (!SaveManager.ShowAdsScreen.HasFlag(ShowAdsState.Accepted) && !SaveManager.BoughtNoAds)
{
base.gameObject.SetActive(true);
while (base.gameObject.activeSelf)
{
yield return null;
}
}
yield break;
}
public void Close()
{
SaveManager.ShowAdsScreen |= ShowAdsState.Accepted;
}
public void Update()
{
if (SaveManager.BoughtNoAds)
{
base.GetComponent<TransitionOpen>().Close();
}
}
public void TogglePersonalizedAd()
{
ShowAdsState showAdsState = SaveManager.ShowAdsScreen & (ShowAdsState)127;
if (showAdsState != ShowAdsState.Personalized)
{
if (showAdsState == ShowAdsState.NonPersonalized)
{
SaveManager.ShowAdsScreen = ShowAdsState.Personalized;
goto IL_34;
}
if (showAdsState == ShowAdsState.Purchased)
{
SaveManager.ShowAdsScreen = ShowAdsState.Purchased;
goto IL_34;
}
}
SaveManager.ShowAdsScreen = ShowAdsState.NonPersonalized;
IL_34:
this.UpdateButtons();
}
public void UpdateButtons()
{
this.PersonalizedAdsButton.UpdateText(!SaveManager.ShowAdsScreen.HasFlag(ShowAdsState.NonPersonalized));
}
}
|