Exemple #1
0
    //call this once the last level's time has been computed (during Player's Final state)
    public static void ComputeClearTime()
    {
        float t = 0;

        string[] levelTimeKeys = UserData.instance.GetKeys(itm => itm.Key.LastIndexOf(LevelController.levelTimePostfix) != -1);

        for (int i = 0; i < levelTimeKeys.Length; i++)
        {
            t += UserData.instance.GetFloat(levelTimeKeys[i]);
        }

        float oldT = UserSlotData.GetSlotValueFloat(UserSlotData.currentSlot, timeKey, float.MaxValue);

        if (t < oldT)
        {
            UserSlotData.SetSlotValueFloat(UserSlotData.currentSlot, timeKey, t);
        }
    }
Exemple #2
0
 public static float GetClearTime(int slot)
 {
     return(UserSlotData.GetSlotValueFloat(slot, timeKey));
 }