hch
7 天以前 8ab9fbf1e44b842646f00bc70dcd99d49f30f2e0
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
 
using System.Collections.Generic;
using System;
 
//用于记录主界面的一些信息
 
public class PlayerMainDate : GameSystemManager<PlayerMainDate>
{
    public event Action AddPowerEvent;
 
 
    //-------用于每分钟经验的获取
    public delegate void OnExperience(int _source, int _ExpPoint, int _Exp);//(1.单位经验亿点,2.经验单位点)
    public static event OnExperience Event_Experience;
 
    //--------------------用于战斗力滚动
 
    public long prowNum = 0;
    public long prowNumChange = 0;
    public bool isAdd = true;//为true增加 为false减少
    private bool prowBool = true;
 
    public event Func<bool> customDisplayPower;
 
    public override void Init()
    {
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
    }
 
 
    public override void Release()
    {
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
    }
 
 
 
    public void OnBeforePlayerDataInitialize()
    {
        prowNum = 0;
        prowNumChange = 0;
        prowBool = true;
        
    }
 
 
    public void PowerAdd(ulong power)
    {
        if (prowBool)
        {
            prowNum = (long)power;
            prowBool = false;
        }
        else
        {
            if ((long)power > prowNum)
            {
                prowNumChange = (long)power - prowNum;
                prowNum = (long)power;
                isAdd = true;
                if (customDisplayPower != null && customDisplayPower())
                {
                    return;
                }
                if (UIManager.Instance.IsOpened<PowerAddWin>())
                {
                    AddPowerEvent?.Invoke();
                    return;
                }
                UIManager.Instance.OpenWindow<PowerAddWin>();
            }
            else if ((long)power < prowNum)
            {
                prowNumChange = prowNum - (long)power;
                prowNum = (long)power;
                isAdd = false;
                if (customDisplayPower != null && customDisplayPower())
                {
                    return;
                }
                if (UIManager.Instance.IsOpened<PowerAddWin>())
                {
                    AddPowerEvent?.Invoke();
                    return;
                }
                UIManager.Instance.OpenWindow<PowerAddWin>();
            }
            else
            {
                prowNum = (long)power;
            }
        }
    }
 
    // public void CustomPowerUp(ulong nowPower ,ulong addPower)
    // {
    //     prowNum = (long)nowPower;
    //     prowNumChange = (long)addPower;
    //     isAdd = true;
    //     if (UIManager.Instance.IsOpened<PowerAddWin>())
    //     {
    //         AddPowerEvent?.Invoke();
    //         return;
    //     }
    //     UIManager.Instance.OpenWindow<PowerAddWin>();
    // }
 
  
}