Pathfinding.Path.GetTotalLength C# (CSharp) Method

GetTotalLength() public method

public GetTotalLength ( ) : float
return float
		public float GetTotalLength () {
			if (vectorPath == null) return float.PositiveInfinity;
			float tot = 0;
			for (int i=0;i<vectorPath.Count-1;i++) tot += Vector3.Distance (vectorPath[i],vectorPath[i+1]);
			return tot;
		}

Usage Example

Beispiel #1
0
 public void OnPathComplete(Path p)
 {
     if(p.error)
     {
         length = -1.0f;
     }
     else
     {
         length = p.GetTotalLength();
         startSearch();
     }
 }
All Usage Examples Of Pathfinding.Path::GetTotalLength