public RepeatPathExtension SpawnRepeatPathExtension( GameObject prefab, NoteObject head, int lastRepeatNotePulse) { GameObject o = Instantiate(prefab, transform); float x = OutOfBoundXPositionBeforeScan(); float y = scanHeight - (head.note.lane + 0.5f) * laneHeight; RectTransform rect = o.GetComponent <RectTransform>(); rect.pivot = new Vector2(0.5f, 0.5f); rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.zero; rect.anchoredPosition = new Vector2(x, y); rect.sizeDelta = new Vector2(laneHeight, laneHeight); RepeatPathExtension extension = o.GetComponent <RepeatPathExtension>(); repeatPathExtensions.Add(extension); extension.Initialize(this, head, lastRepeatNotePulse); return(extension); }
public void RegisterRepeatPathExtension( RepeatPathExtension extension) { repeatPathExtensions.Add(extension); }