GetPathEnumerator() public method

public GetPathEnumerator ( ) : IEnumerator
return IEnumerator
Example #1
0
    public void Start()
    {
        if (Path == null)
        {
            Debug.LogError("Path cannot be null", gameObject);
        }

        _currentPoint = Path.GetPathEnumerator();
        _currentPoint.MoveNext();

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

        transform.position = _currentPoint.Current.position;
    }
Example #2
0
 public void Start()
 {
     if (path == null)
     {
         Debug.LogError("Path boş bırakıldı!", gameObject);
         return;
     }
     _currentPoint = path.GetPathEnumerator();
     _currentPoint.MoveNext();
     transform.position = _currentPoint.Current.position;
 }
Example #3
0
    public void Start()
    {
        if (Path == null)
        {
            return;
        }
        _currentPoint = Path.GetPathEnumerator();
        _currentPoint.MoveNext();

        if (_currentPoint.Current == null)
        {
            return;
        }
        transform.position = _currentPoint.Current.position;
    }
Example #4
0
 public void Start()
 {
     if (path == null)
     {
         Debug.LogError("Path cannot be null!!!!");
         return;
     }
     _currPoint = path.GetPathEnumerator();
     _currPoint.MoveNext();
     if (_currPoint.Current == null)
     {
         return;
     }
     transform.position = _currPoint.Current.position;
 }
Example #5
0
    public void Start()
    {
        _Path = GameObject.Find("EnemyPath");
        path  = _Path.GetComponent <PathDefinition>();

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

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

        transform.position = _currentPoint.Current.position;
    }
Example #6
0
    // Use this for initialization
    public void Start()
    {
        if (Path == null)
        {
            Debug.LogError("Es muss ein Pfad gesetzt werden");
            return;
        }

        _currentPoint = Path.GetPathEnumerator();
        _currentPoint.MoveNext();

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

        transform.position = _currentPoint.Current.position;
    }
Example #7
0
    public void Start()
    {
        if (Path == null)
        {
            Debug.LogError("Path cannot be null", gameObject);
            return;
        }

        _currentPoint = Path.GetPathEnumerator(); //Note: it not executes GetPathEnumerator
        _currentPoint.MoveNext();                 //Trigger first exeution of iterator block

        if (_currentPoint == null)
        {
            return;
        }

        transform.position = _currentPoint.Current.position;
    }
Example #8
0
    public void Start()
    {
        Player = GetComponent <Rigidbody2D> ();
        if (path == null)
        {
            Debug.LogError("Path cannot be found", gameObject);
            return;
        }
        _currentPoint = path.GetPathEnumerator();
        _currentPoint.MoveNext();

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

        transform.position = _currentPoint.Current.position;
    }
    // Use this for initialization
    private void Start()
    {
        lastTargetPosition = target.position;
        offsetZ            = (transform.position - target.position).z;
        transform.parent   = null;

        if (Path == null)
        {
            return;
        }
        currentCameraPointPreview = Path.GetPathEnumerator();
        currentCameraPointPreview.MoveNext();

        if (currentCameraPointPreview.Current == null)
        {
            return;
        }
        transform.position = currentCameraPointPreview.Current.position;
    }
Example #10
0
    // -------------------------------------------------------------------------
    public void Reset()
    {
        if (mPathDefinition == null)
        {
            Debug.LogError(gameObject + ": path definition cannot be null");
            return;
        }

        mPathNodes = mPathDefinition.GetPathEnumerator();
        mPathNodes.MoveNext();

        mCurrentPathNode = mPathNodes.Current;

        mPathNodes.MoveNext();
        mTargetPathNode = mPathNodes.Current;

        mTimer.Set(mCurrentPathNode.Delay);
        mState = ePathFollowerState.Waiting;

        mFinished = false;
    }