Exemple #1
0
 public static void Modify(ViTimeNodeInterface node, ViTime64 deltaTime)
 {
     if (node.IsAttach() == false)        //! 如果回调已经发生过了, 则无法进行重新设置
     {
         return;
     }
     if (node.Time > -deltaTime)
     {
         node.SetTime(node.Time + deltaTime);
     }
     else
     {
         node.SetTime(0);
     }
     _timer.Add(node);
 }
Exemple #2
0
    //+-------------------------------------------------------------------------------------------------------------------------------------------------------------
    public static void SetFreq(ViTimeNodeInterface node, float oldFreq, float newFreq)
    {
        if (node.IsAttach() == false)        //! 如果回调已经发生过了, 则无法进行重新设置
        {
            return;
        }
        ViTime64 currentTime     = _timer.Time;
        ViTime64 delta           = node.Time - currentTime;
        ViTime64 deltaTimeOldMod = (delta > 0) ? delta : 0;
        ViTime64 deltaTime       = (ViTime64)(deltaTimeOldMod * oldFreq);
        ViTime64 deltaTimeNewMod = (ViTime64)(deltaTime / newFreq);

        node.SetTime(_timer.Time + deltaTimeNewMod);
        _timer.Add(node);
    }
Exemple #3
0
 public void Add(ViTimeNodeInterface node)
 {
     if (node.Time < _roll0.TimeInf)
     {
         node.SetTime(_roll0.TimeInf);
     }
     if (_roll0.InRange(node.Time))
     {
         _roll0.Add(node);
         return;
     }
     if (_roll1.InRange(node.Time))
     {
         _roll1.Add(node);
         return;
     }
     _AddEvent(_reserveList, node);
 }