private List <FigureController> SpawnFigures(GameObject figurePrefab, int figureNumber, float speed, IHideInputWrapper hideInputWrapper) { List <FigureController> figures = new List <FigureController>(); for (int i = 0; i < figureNumber; i++) { GameObject spawnedFigureObject = Instantiate(figurePrefab); FigureController figureController = spawnedFigureObject.GetComponent <FigureController>(); figures.Add(figureController); figureController.Initialize(speed, hideInputWrapper); spawnedFigureObject.transform.position = GetRandomPositionWithinConstraints(); } return(figures); }
public void Initialize(float speed, IHideInputWrapper hideInputWrapper) { this.speed = speed; this.hideInputWrapper = hideInputWrapper; initialized = true; }