public void resetFoodPoints() { List <Vector3> newPositions = pointsCointainer.getAllMapPoints(); try{ for (int i = 0; i < newPositions.Count; i++) { positions[i] = new Position(newPositions[i]); } }catch (IndexOutOfRangeException e) { Debug.Log("wtf"); } currentIndex = 0; }
public Food(HerdParameters herdParameters, Transform visualFoodTransform) { sectorManager = GameObject.FindGameObjectWithTag("Sector").GetComponent<SectorsManager>(); pointsCointainer = sectorManager.getContainerClone(); List<Vector3> initialTrace = pointsCointainer.getAllMapPoints(); positions = new Position[initialTrace.Count]; visualFoodPosition = visualFoodTransform; this.herdParameters = herdParameters; for(int i = 0; i < initialTrace.Count; i++){ positions[i] = new Position(initialTrace[i]); } initCenterPositions(); }
public Food(HerdParameters herdParameters, Transform visualFoodTransform) { sectorManager = GameObject.FindGameObjectWithTag("Sector").GetComponent <SectorsManager>(); pointsCointainer = sectorManager.getContainerClone(); List <Vector3> initialTrace = pointsCointainer.getAllMapPoints(); positions = new Position[initialTrace.Count]; visualFoodPosition = visualFoodTransform; this.herdParameters = herdParameters; for (int i = 0; i < initialTrace.Count; i++) { positions[i] = new Position(initialTrace[i]); } initCenterPositions(); }
public List <Vector3> getAllMapPoints() { return(pointsCointerner.getAllMapPoints()); }