public void GenerateLocationMarker(Transform platformTransform, MarkerType markerType) { UISettings settings = GameManager.Instance.uiSettings; GameObject generatedInstance = Instantiate(settings.markerPrefab, this.transform); ILocationMarker markerInterface = generatedInstance.GetComponent <ILocationMarker>(); markerInterface.InitialiseMarker(platformTransform, rectTransform); markerInterface.SetMarkerConstraints(this); markerInterface.SetMarkerIconType(markerType); List <ILocationMarker> tempArray = new List <ILocationMarker>(); CopyAllItemsFromArray(tempArray); tempArray.Add(markerInterface); UpdateArrayCollection(tempArray); }