Example #1
0
    // Use this for initialization
    void Awake()
    {
        editor = GetComponent <ChartEditor>();

        GameObject groupMovePool = new GameObject("Main Song Object Pool");

        noteParent          = new GameObject("Notes");
        starpowerParent     = new GameObject("Starpowers");
        bpmParent           = new GameObject("BPMs");
        timesignatureParent = new GameObject("Time Signatures");
        sectionParent       = new GameObject("Sections");
        songEventParent     = new GameObject("Global Events");
        chartEventParent    = new GameObject("Chart Events");

        notePool = new NotePool(noteParent, editor.notePrefab, NOTE_POOL_SIZE);
        noteParent.transform.SetParent(groupMovePool.transform);

        spPool = new StarpowerPool(starpowerParent, editor.starpowerPrefab, POOL_SIZE);
        starpowerParent.transform.SetParent(groupMovePool.transform);

        bpmPool = new BPMPool(bpmParent, editor.bpmPrefab, POOL_SIZE);
        bpmParent.transform.SetParent(groupMovePool.transform);

        tsPool = new TimesignaturePool(timesignatureParent, editor.tsPrefab, POOL_SIZE);
        timesignatureParent.transform.SetParent(groupMovePool.transform);

        sectionPool = new SectionPool(sectionParent, editor.sectionPrefab, POOL_SIZE);
        sectionParent.transform.SetParent(groupMovePool.transform);

        songEventPool = new EventPool(songEventParent, editor.songEventPrefab, POOL_SIZE);
        songEventParent.transform.SetParent(groupMovePool.transform);

        chartEventPool = new ChartEventPool(chartEventParent, editor.chartEventPrefab, POOL_SIZE);
        chartEventParent.transform.SetParent(groupMovePool.transform);
    }
Example #2
0
    // Use this for initialization
    void Awake()
    {
        editor = ChartEditor.Instance;

        GameObject groupMovePool = new GameObject("Main Song Object Pool");

        noteParent          = new GameObject("Notes");
        starpowerParent     = new GameObject("Starpowers");
        bpmParent           = new GameObject("BPMs");
        timesignatureParent = new GameObject("Time Signatures");
        sectionParent       = new GameObject("Sections");
        songEventParent     = new GameObject("Global Events");
        chartEventParent    = new GameObject("Chart Events");

        notePool = new NotePool(noteParent, editor.assets.notePrefab, NOTE_POOL_SIZE);
        noteParent.transform.SetParent(groupMovePool.transform);

        spPool = new StarpowerPool(starpowerParent, editor.assets.starpowerPrefab, POOL_SIZE);
        starpowerParent.transform.SetParent(groupMovePool.transform);

        bpmPool = new BPMPool(bpmParent, editor.assets.bpmPrefab, POOL_SIZE);
        bpmParent.transform.SetParent(groupMovePool.transform);

        tsPool = new TimesignaturePool(timesignatureParent, editor.assets.tsPrefab, POOL_SIZE);
        timesignatureParent.transform.SetParent(groupMovePool.transform);

        sectionPool = new SectionPool(sectionParent, editor.assets.sectionPrefab, POOL_SIZE);
        sectionParent.transform.SetParent(groupMovePool.transform);

        songEventPool = new EventPool(songEventParent, editor.assets.songEventPrefab, POOL_SIZE);
        songEventParent.transform.SetParent(groupMovePool.transform);

        chartEventPool = new ChartEventPool(chartEventParent, editor.assets.chartEventPrefab, POOL_SIZE);
        chartEventParent.transform.SetParent(groupMovePool.transform);

        editor.events.hyperspeedChangeEvent.Register(SetAllPoolsDirty);
        editor.events.chartReloadedEvent.Register(SetAllPoolsDirty);
        editor.events.leftyFlipToggledEvent.Register(SetAllPoolsDirty);
        editor.events.drumsModeOptionChangedEvent.Register(SetAllNotesDirty);
        editor.events.playbackStoppedEvent.Register(OnPlaybackStopped);
    }