コード例 #1
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);
    }
コード例 #2
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);
 }