Пример #1
0
 public void SaveFeeling(string path, FeelingInterface feeling)
 {
     // try to append new feeling to existing xml on device
     // if there is none create one
     try
     {
         TSC = TunneStructContainer.Load(path);
         TunneStruct[] temp = TSC.TunneStructArray;
         TSC.TunneStructArray = new TunneStruct[temp.Length + 1];
         for (int i = 0; i < temp.Length; i++)
         {
             TSC.TunneStructArray[i] = temp[i];
         }
         TSC.TunneStructArray[temp.Length] = (TunneStruct)feeling;
         TSC.Save(path);
     }
     catch (Exception e)
     {
         TunneStructContainer    TSC         = new TunneStructContainer();
         List <FeelingInterface> feelingList = new List <FeelingInterface>();
         feelingList.Add(feeling);
         TSC.Save(path, feelingList);
         // Debug.Log(e.ToString());
     }
 }
Пример #2
0
 public void UpdateCurrentFeeling(FeelingInterface FI)
 {
     currentFeeling = FI;
     if (feelingText1.text == "")
     {
         currentFeelings[0] = FI;
         feelingText1.text  = currentFeelings[0].feeling;
     }
     else if (feelingText2.text == "")
     {
         currentFeelings[1] = FI;
         feelingText2.text  = currentFeelings[1].feeling;
     }
     else if (feelingText3.text == "")
     {
         currentFeelings[2] = FI;
         feelingText3.text  = currentFeelings[2].feeling;
     }
 }
Пример #3
0
 public void addToListOfFeelings(FeelingInterface feel)
 {
     listOfFeelings.Add(feel);
     howManyFeelings++;
 }