public int GetNodeId(Node node) { for (int i = 0; i < _nodes.Count; ++i) { if (_nodes[i] == node) return i; } return -1; }
private void StartMoving() { _currentNode = _currentNode.NextNode; //If there is no follow up node, we've reached the end! if (_currentNode == null) { Debug.Log(gameObject.name + " is already onb the finish line!"); return; } StartCoroutine(MoveRoutine(_currentNode.transform.position + _offset)); }
public void SetCurrentNode(Node node) { _currentNode = node; transform.position = _currentNode.transform.position + _offset; }