I am making an rts using a tutorial and making changes that I want as I go through it. However I have hit a roadblock. I can not figure out how to fix this error. It is in line 17 and the error says “The type or namespace name List
1’ could not be found.” Any help would be greatly appreciated.
public static Rect CalculateSelectionBox(Bounds selectionBounds, Rect playingArea) {
//shorthand for the coordinates of the centre of the selection bounds
float cx = selectionBounds.center.x;
float cy = selectionBounds.center.y;
float cz = selectionBounds.center.z;
//shorthand for the coordinates of the extents of the selection bounds
float ex = selectionBounds.extents.x;
float ey = selectionBounds.extents.y;
float ez = selectionBounds.extents.z;
//Determine the screen coordinates for the corners of the selection bounds
List<Vector3> corners = new List<Vector3>();
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx+ex, cy+ey, cz+ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx+ex, cy+ey, cz-ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx+ex, cy-ey, cz+ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx-ex, cy+ey, cz+ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx+ex, cy-ey, cz-ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx-ex, cy-ey, cz+ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx-ex, cy+ey, cz-ez)));
corners.Add(Camera.mainCamera.WorldToScreenPoint(new Vector3(cx-ex, cy-ey, cz-ez)));
//Determine the bounds on screen for the selection bounds
Bounds screenBounds = new Bounds(corners[0], Vector3.zero);
for(int i = 1; i < corners.Count; i++) {
screenBounds.Encapsulate(corners*);*
-
}*
-
//Screen coordinates start in the bottom left corner, rather than the top left corner*
-
//this correction is needed to make sure the selection box is drawn in the correct place*
-
float selectBoxTop = playingArea.height - (screenBounds.center.y + screenBounds.extents.y);*
-
float selectBoxLeft = screenBounds.center.x - screenBounds.extents.x;*
_ float selectBoxWidth = 2 * screenBounds.extents.x;_
_ float selectBoxHeight = 2 * screenBounds.extents.y;_
-
return new Rect(selectBoxLeft, selectBoxTop, selectBoxWidth, selectBoxHeight);*
-
}*