yyl
2 天以前 973edc44a04dceb8b48a32ca912e6167f86189d4
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, May 09, 2018
//--------------------------------------------------------
 
using System;
using UnityEngine;
using UnityEngine.UI;
 
public class GotoChargeWin : UIBase
{
    [SerializeField] Text m_CTGStageDisplay;
    public long startTime = DateTime.Now.Ticks;
    
 
    private void Update() {
#if !UNITY_EDITOR
        if (SDKUtils.Instance.FreePlatformInfo == null || string.IsNullOrEmpty(SDKUtils.Instance.FreePlatformInfo.account)){
            return;
        }
        if (DateTime.Now.Ticks - startTime > 50000000)
        {
            CloseWindow();
        }
#endif
 
        if (DateTime.Now.Ticks - startTime > 10000000)
        {
            CloseWindow();
        }
 
    }
    protected override void OnPreOpen()
    {
        SDKUtils.Instance.onFreePlatformPayCancel += OnChargeComplete;
        SDKUtils.Instance.onFreePlatformPayFail += OnChargeComplete;
        SDKUtils.Instance.onFreePlatformPayOk += OnChargeComplete;
 
        m_CTGStageDisplay.text = Language.Get("GotoCharging");
        RechargeManager.Instance.OnCTGStageChange += OnCTGStageChange;
 
        startTime = DateTime.Now.Ticks;
    }
 
 
    protected override void OnPreClose()
    {
        SDKUtils.Instance.onFreePlatformPayCancel -= OnChargeComplete;
        SDKUtils.Instance.onFreePlatformPayFail -= OnChargeComplete;
        SDKUtils.Instance.onFreePlatformPayOk -= OnChargeComplete;
        RechargeManager.Instance.OnCTGStageChange -= OnCTGStageChange;
    }
 
 
 
    private void OnCTGStageChange(string _display)
    {
        m_CTGStageDisplay.text = _display;
    }
    private void OnChargeComplete()
    {
        CloseWindow();
    }
}