chenxin
2020-11-11 f2f4e1e45981bb294a5221ade7b4646cc3e29d35
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
using UnityEngine;
using System;
 
/**
 * 无尽模式分数数据
 * @Author: chenxin
 * @Date: 2020-11-10 13:55:10
 */
namespace KTGMGemClient
{
    public class EndlessScoreData
    {
        private static int preScore;
 
        /// <summary>
        /// 上一次的分数
        /// </summary>
        public static int PreScore
        {
            get { return preScore; }
        }
 
        private static int currentScore;
 
        /// <summary>
        /// 当前获得分数
        /// </summary>
        public static int CurrentSocre
        {
            get { return currentScore; }
            set
            {
                if (value > 9999999) value = 9999999;
                else if (value < 0) value = 0;
 
                preScore = currentScore;
                currentScore = value;
                formatScore = currentScore.ToString().PadLeft(7, '0');
            }
        }
 
        private static string formatScore = "0000000";
 
        /// <summary>
        /// 格式化的分数显示,7位数显示
        /// </summary>
        public static string FormatScore
        {
            get { return formatScore; }
        }
    }
}