Exemple #1
0
 // Moves player to next level along the desired path
 void MovePlayer()
 {
     _currentPoint = playerMovePath.GetPathsEnumerator();
     _currentPoint.MoveNext();
     transform.position = _currentPoint.Current.position;
     isMoving           = true;
     numStops           = playerMovePath.pathPoints.Length;
     currentStop        = 0;
 }
Exemple #2
0
    public void Start()
    {
        if (path == null)
        {
            Debug.LogError("Path cannot be null ", gameObject);
            return;
        }

        _currentPoint = path.GetPathsEnumerator();
        _currentPoint.MoveNext();

        if (_currentPoint.Current == null)
        {
            return;
        }

        transform.position = _currentPoint.Current.position;
    }