コード例 #1
0
    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);
    }
コード例 #2
0
 public void RegisterRepeatPathExtension(
     RepeatPathExtension extension)
 {
     repeatPathExtensions.Add(extension);
 }