コード例 #1
0
ファイル: ViRoute.cs プロジェクト: xubingyue/def
    //
    bool _UpdateDistance(float distance)
    {
        if (_nextNode == null)
        {
            return(false);
        }
        ViVector3 nextPos   = _nextNode._pos;
        float     distRight = Distance(_currentPos, nextPos);

        if (distRight > distance)
        {
            _currentPos += _dir * distance;
        }
        else
        {
            float newDistance = distance - distRight;
            _currentPos = nextPos;
            _prePos     = nextPos;
            if (ViRouteNode.HasEvent(_nextNode._eventId))
            {
                _endCallbackList.Invoke(_nextNode._eventId);
            }
            S_Nodes.Delete(_nodes.GetHead());
            _nextNode = _LerpToNextNode();
            if (_nextNode != null)
            {
                _UpdateDistance(newDistance);
            }
            else
            {
                _ClearState();
            }
        }
        return(true);
    }
コード例 #2
0
ファイル: ViRoute.cs プロジェクト: xubingyue/def
 void _ClearNodeList()
 {
     S_Nodes.Delete(_nodes);
 }