Exemplo n.º 1
0
    public void PathCreate(List <GameObject> nodeArray)
    {
        _currentNodeCounter = 0;
        _path.Clear();
        for (int i = nodeArray.Count; i > 0; i--)
        {
            _path.Add(nodeArray[i - 1]);
            if (_debug)
            {
                Debug.Log("Player node next: " + nodeArray[i - 1]);
            }
        }

        _directionState = _directionStateEnum.noDirection;
        _moveState      = _moveStateEnum.walk;
    }
Exemplo n.º 2
0
    private void nextNodeInit()
    {
        lockToNode(_path[_currentNodeCounter + 1]);

        if (_currentNodeCounter >= _path.Count - 2)
        {
            _moveState = _moveStateEnum.idle;
            return;
        }

        if (_path.Count - 1 >= _currentNodeCounter + 2)
        {
            _currentNodeCounter++;
        }
        if (_debug)
        {
            Debug.Log("Player current node: " + _path[_currentNodeCounter + 1]);
        }
        _directionState = _directionStateEnum.noDirection;
    }