Beispiel #1
0
    public Vector3 GetNextTargetPoint()
    {
        while (true)
        {
            if (waypoints.wayPoints[targetWayPointIndex].position.z - player.transform.position.z < 10)
            {
                targetWayPointIndex--;

                if (targetWayPointIndex < 0)
                {
                    forestDenerator.GeneratorForeast();
                    //Destroy(this.gameObject, 2);
                    return(forestDenerator.foreast1.GetComponent <Forest>().GetNextTargetPoint());
                }
            }
            else
            {
                return(waypoints.wayPoints[targetWayPointIndex].position);
            }
        }
    }