Exemplo n.º 1
0
 void Awake()
 {
     instance    = this;
     timeManager = GameManager.GetComponent <TimeManager>();
     if (saveFileName == null)
     {
         Debug.LogError("File Name is null");
         return;
     }
     playerData = SaveSystem.Load(saveFileName);
     if (playerData == null)
     {
         playerData = new PlayerData(N);
     }
     Debug.Log("Load Record Time:" + playerData.m_N);
 }
Exemplo n.º 2
0
    void Start()
    {
        recordDisplayer = GetComponentInParent <RecordDisplayer>();
        m_Color         = new Color(1, 1, 1, 0.01f);
        string tempSaveTime = recordDisplayer.GetSaveTime();   //通过获取存档时间是否为空,来得知该条记录是否已达到实际存储的最高记录条目数,如果是,那么就不再给接下来两项赋值,如果不是,正常给赋值

        if (tempSaveTime == null)
        {
            return;
        }
        m_TextArray[0].text = "#" + recordDisplayer.GetRecordIndex().ToString();
        m_TextArray[1].text = tempSaveTime;
        m_TextArray[2].text = recordDisplayer.GetRecordTime().ToString();
        if (status = recordDisplayer.GetNewestStatus())
        {
            m_TextArray[3].text = "New Record";
        }
    }