Ejemplo n.º 1
0
    public override void SortObjects()
    {
        LoadedContainers = new List <BeatmapObjectContainer>(
            LoadedContainers.OrderBy(x => x.objectData._time)    //0 -> end of map
            .ThenBy(x => ((BeatmapNote)x.objectData)._lineIndex) //0 -> 3
            .ThenBy(x => ((BeatmapNote)x.objectData)._lineLayer) //0 -> 2
            .ThenBy(x => ((BeatmapNote)x.objectData)._type));    //Red -> Blue -> Bomb
        uint id = 0;

        foreach (var container in LoadedContainers)
        {
            if (container.objectData is BeatmapNote noteData)
            {
                noteData.id = id;
                id++;
            }
            if (container.OutlineVisible && !SelectionController.IsObjectSelected(container))
            {
                container.OutlineVisible = false;
            }
            //Gain back some performance by stopping here if we already have the object's materials.
            //Obviously on first load it's gonna suck ass however after that, we should be fine.
            if (objectsWithNoteMaterials.Add(container))
            {
                foreach (Renderer renderer in container.GetComponentsInChildren <Renderer>())
                {
                    foreach (Material mat in renderer.materials.Where(x => x?.HasProperty("_Editor_IsPlaying") ?? false))
                    {
                        allNoteRenderers.Add(mat);
                    }
                }
            }
        }
        UseChunkLoading = true;
    }
Ejemplo n.º 2
0
 public override void SortObjects()
 {
     float[] bpmChangeTimes = new float[ShaderArrayMaxSize];
     float[] bpmChangeBPMS  = new float[ShaderArrayMaxSize];
     bpmChangeTimes[0] = 0;
     bpmChangeBPMS[0]  = BeatSaberSongContainer.Instance.song.beatsPerMinute;
     LoadedContainers  = LoadedContainers.OrderBy(x => x.objectData._time).ToList();
     for (int i = 0; i < LoadedContainers.Count; i++)
     {
         if (i >= ShaderArrayMaxSize - 1)
         {
             Debug.LogError($":hyperPepega: :mega: THE CAP FOR BPM CHANGES IS {ShaderArrayMaxSize - 1}, WHY TF DO YOU HAVE THIS MANY BPM CHANGES!?!?");
             break;
         }
         BeatmapBPMChangeContainer con = LoadedContainers[i] as BeatmapBPMChangeContainer;
         con.UpdateGridPosition();
         BeatmapBPMChange bpmChange = con.objectData as BeatmapBPMChange;
         bpmChangeTimes[i + 1] = bpmChange._time;
         bpmChangeBPMS[i + 1]  = bpmChange._BPM;
     }
     foreach (Renderer renderer in allGridRenderers)
     {
         renderer.material.SetFloatArray(Times, bpmChangeTimes);
         renderer.material.SetFloatArray(BPMs, bpmChangeBPMS);
         renderer.material.SetInt(BPMCount, LoadedContainers.Count + 1);
     }
     measureLinesController.RefreshMeasureLines();
 }
Ejemplo n.º 3
0
 public override void SortObjects()
 {
     LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time).ThenBy(x => (x.objectData as BeatmapCustomEvent)?._type).ToList();
     customEventTypes = customEventTypes.OrderBy(x => x).ToList();
     RefreshTrack();
     UseChunkLoading = true;
 }
Ejemplo n.º 4
0
 public override void SortObjects()
 {
     LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time).ToList();
     foreach (BeatmapBPMChangeContainer con in LoadedContainers)
     {
         con.UpdateGridPosition();
     }
 }
Ejemplo n.º 5
0
    public override void SortObjects()
    {
        LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time).ToList();
        uint id = 0;

        for (int i = 0; i < LoadedContainers.Count; i++)
        {
            if (LoadedContainers[i].objectData is BeatmapNote noteData)
            {
                noteData.id = id;
                LoadedContainers[i].gameObject.name = "Note " + id;
                id++;
            }
        }
        UseChunkLoading = true;
    }
Ejemplo n.º 6
0
    public override void SortObjects()
    {
        RefreshRenderers();
        LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time).ToList();
        uint id = 0;

        foreach (var t in LoadedContainers)
        {
            if (t.objectData is BeatmapObstacle noteData)
            {
                noteData.id       = id;
                t.gameObject.name = "Obstacle " + id;
                id++;
            }
        }
        UseChunkLoading = true;
    }
Ejemplo n.º 7
0
    public override void SortObjects()
    {
        obstacleRenderer = GridTransform.GetComponentsInChildren <Renderer>();
        LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time).ToList();
        uint id = 0;

        for (int i = 0; i < LoadedContainers.Count; i++)
        {
            if (LoadedContainers[i].objectData is BeatmapObstacle)
            {
                BeatmapObstacle noteData = (BeatmapObstacle)LoadedContainers[i].objectData;
                noteData.id = id;
                LoadedContainers[i].gameObject.name = "Obstacle " + id;
                id++;
            }
        }
        UseChunkLoading = true;
    }
Ejemplo n.º 8
0
    public override void SortObjects()
    {
        LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time)    //0 -> end of map
                           .ThenBy(x => ((BeatmapNote)x.objectData)._lineLayer) //0 -> 2
                           .ThenBy(x => ((BeatmapNote)x.objectData)._lineIndex) //0 -> 3
                           .ThenBy(x => ((BeatmapNote)x.objectData)._type)      //Red -> Blue -> Bomb
                           .ToList();
        uint id = 0;

        foreach (var t in LoadedContainers)
        {
            if (t.objectData is BeatmapNote noteData)
            {
                noteData.id       = id;
                t.gameObject.name = "Note " + id;
                id++;
            }
        }
        UseChunkLoading = true;
    }
Ejemplo n.º 9
0
    public override void SortObjects()
    {
        LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time)      //0 -> end of map
                           .ThenBy(x => (x.objectData as BeatmapNote)._lineLayer) //0 -> 2
                           .ThenBy(x => (x.objectData as BeatmapNote)._type)      //Red -> Blue -> Bomb
                           .ThenBy(x => (x.objectData as BeatmapNote)._lineIndex) //0 -> 3
                           .ToList();
        uint id = 0;

        for (int i = 0; i < LoadedContainers.Count; i++)
        {
            if (LoadedContainers[i].objectData is BeatmapNote noteData)
            {
                noteData.id = id;
                LoadedContainers[i].gameObject.name = "Note " + id;
                id++;
            }
        }
        UseChunkLoading = true;
    }
Ejemplo n.º 10
0
 public override void SortObjects()
 {
     LoadedContainers = LoadedContainers.OrderBy(x => x.objectData._time).ToList();
     StartCoroutine(WaitUntilChunkLoad());
 }