Exemplo n.º 1
0
 public static bool Check(PlayerController player)
 {
     if (tta.Count == 0)
     {
         tta.Add(new TimeToAction(player, Time.time));
         return(true);
     }
     for (int i = tta.Count - 1; i > -1; i--)
     {
         TimeToAction tt = tta[i];
         if (tt.Object == player)
         {
             if (tt.time + 0.5f < Time.time)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             if (tt.time + 0.5f < Time.time)
             {
                 tta.RemoveAt(i);
             }
         }
     }
     tta.Add(new TimeToAction(player, Time.time));
     return(true);
 }
Exemplo n.º 2
0
 public static void ResetTime(PlayerController player)
 {
     for (int i = tta.Count - 1; i > -1; i--)
     {
         TimeToAction tt = tta[i];
         if (tt.Object == player)
         {
             tt.time = Time.time;
         }
     }
 }