コード例 #1
0
 // Token: 0x060008A0 RID: 2208 RVA: 0x0009C208 File Offset: 0x0009A608
 private void Update()
 {
     if (!this.Show)
     {
         base.transform.localPosition = new Vector3(Mathf.Lerp(base.transform.localPosition.x, 1050f, Time.deltaTime * 10f), base.transform.localPosition.y, base.transform.localPosition.z);
     }
     else
     {
         base.transform.localPosition = new Vector3(Mathf.Lerp(base.transform.localPosition.x, 0f, Time.deltaTime * 10f), base.transform.localPosition.y, base.transform.localPosition.z);
         if (this.InputManager.TappedDown)
         {
             this.ID++;
             if (this.ID > 3)
             {
                 this.ID = 1;
             }
             this.UpdateHighlight();
         }
         if (this.InputManager.TappedUp)
         {
             this.ID--;
             if (this.ID < 1)
             {
                 this.ID = 3;
             }
             this.UpdateHighlight();
         }
         if (Input.GetButtonDown("A"))
         {
             if (this.SaveDatas[this.ID].EmptyFile.activeInHierarchy)
             {
                 SaveFile     saveFile = new SaveFile(this.ID);
                 SaveFileData data     = saveFile.Data;
                 data.playerData.kills            = 0;
                 data.schoolData.schoolAtmosphere = 1f;
                 data.playerData.alerts           = 0;
                 data.dateData.week         = 1;
                 data.dateData.weekday      = DayOfWeek.Sunday;
                 data.playerData.reputation = 0f;
                 data.clubData.club         = ClubType.None;
                 saveFile.Save();
                 this.SaveDatas[this.ID].Start();
             }
             else
             {
                 SaveFileGlobals.CurrentSaveFile = this.ID;
                 this.Menu.FadeOut = true;
                 this.Menu.Fading  = true;
             }
         }
         else if (Input.GetButtonDown("X"))
         {
             SaveFile.Delete(this.ID);
             this.SaveDatas[this.ID].Start();
         }
     }
 }
コード例 #2
0
    public void Delete()
    {
        //arrange
        Regex r = new Regex("(You are tring to use \"delete\" on a save file that is not open)");

        //checks that a key is deleted correctly
        saveFile.Set("key", "value");
        Assert.IsTrue(saveFile.HasKey("key"));
        saveFile.Delete("key");
        Assert.IsTrue(!saveFile.HasKey("key"));

        //deletes an unexisting key (shouldn't do anything)
        saveFile.Delete("key");

        //throws error when trying to delete on a closed save file
        saveFile.Close();
        saveFile.Delete("key");
        LogAssert.Expect(LogType.Error, r);
    }
コード例 #3
0
 /// <summary>
 /// Deletes a key-value pair and refreshes the content UI
 /// </summary>
 /// <param name="key">key of the pair to delete</param>
 public void DeleteKey(string key)
 {
     saveFile.Delete(key);
     RefreshContentList();
 }