Beispiel #1
0
    void PlatformLoaded(PlatformDescriptor descriptor)
    {
        for (int i = 0; i < 16; i++)
        {
            int        modified    = BeatmapEventContainer.EventTypeToModifiedType(i);
            GameObject instantiate = Instantiate(LayerInstantiate, LayerInstantiate.transform.parent);
            instantiate.transform.localPosition = new Vector3(modified, 0, 0);
            try
            {
                switch (i)
                {
                case 8:
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = "Ring Rotation";
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = UtilityAsset;
                    break;

                case 9:
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = "Small Ring Zoom";
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = UtilityAsset;
                    break;

                case 12:
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = "Left Laser Speed";
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = UtilityAsset;
                    break;

                case 13:
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = "Right Laser Speed";
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = UtilityAsset;
                    break;

                case 14:
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = "Rotation (Include Current Time)";
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = UtilityAsset;
                    break;

                case 15:
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = "Rotation (Exclude Current Time)";
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = UtilityAsset;
                    break;

                default:
                    LightsManager e = descriptor.LightingManagers[i];
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().text = e?.gameObject.name;
                    instantiate.GetComponentInChildren <TextMeshProUGUI>().font = AvailableAsset;
                    break;
                }
            }
            catch { }
        }
        LayerInstantiate.SetActive(false);
    }
 public void ShiftSelection(int leftRight, int upDown)
 {
     foreach (BeatmapObjectContainer con in SelectedObjects)
     {
         if (con is BeatmapNoteContainer note)
         {
             if (note.mapNoteData._lineIndex >= 1000)
             {
                 note.mapNoteData._lineIndex += Mathf.RoundToInt((1f / atsc.gridMeasureSnapping) * 1000 * leftRight);
                 if (note.mapNoteData._lineIndex < 1000)
                 {
                     note.mapNoteData._lineIndex = 1000;
                 }
             }
             else if (note.mapNoteData._lineIndex <= -1000)
             {
                 note.mapNoteData._lineIndex += Mathf.RoundToInt((1f / atsc.gridMeasureSnapping) * 1000 * leftRight);
                 if (note.mapNoteData._lineIndex > -1000)
                 {
                     note.mapNoteData._lineIndex = -1000;
                 }
             }
             else
             {
                 note.mapNoteData._lineIndex += leftRight;
             }
             note.mapNoteData._lineLayer += upDown;
         }
         else if (con is BeatmapObstacleContainer obstacle)
         {
             if (obstacle.obstacleData._lineIndex >= 1000)
             {
                 obstacle.obstacleData._lineIndex += Mathf.RoundToInt((1f / atsc.gridMeasureSnapping) * 1000 * leftRight);
                 if (obstacle.obstacleData._lineIndex < 1000)
                 {
                     obstacle.obstacleData._lineIndex = 1000;
                 }
             }
             else if (obstacle.obstacleData._lineIndex <= -1000)
             {
                 obstacle.obstacleData._lineIndex += Mathf.RoundToInt((1f / atsc.gridMeasureSnapping) * 1000 * leftRight);
                 if (obstacle.obstacleData._lineIndex > -1000)
                 {
                     obstacle.obstacleData._lineIndex = -1000;
                 }
             }
             else
             {
                 obstacle.obstacleData._lineIndex += leftRight;
             }
             obstacle.obstacleData._time += ((1f / atsc.gridMeasureSnapping) * upDown);
         }
         else if (con is BeatmapEventContainer e)
         {
             e.eventData._time += ((1f / atsc.gridMeasureSnapping) * upDown);
             if (eventPlacement.objectContainerCollection.RingPropagationEditing)
             {
                 int pos = -1 + leftRight;
                 if (con.objectData._customData != null && con.objectData._customData["_propID"].IsNumber)
                 {
                     pos = (con.objectData?._customData["_propID"]?.AsInt ?? -1) + leftRight;
                 }
                 if (e.eventData._type != MapEvent.EVENT_TYPE_RING_LIGHTS)
                 {
                     e.UpdateAlpha(0);
                     pos = -1;
                 }
                 else
                 {
                     if (pos < -1)
                     {
                         pos = -1;
                     }
                     if (pos > 14)
                     {
                         pos = 14;
                     }
                 }
                 con.transform.localPosition = new Vector3(pos + 0.5f, 0.5f, con.transform.localPosition.z);
                 if (pos == -1)
                 {
                     con.objectData._customData?.Remove("_propID");
                 }
                 else
                 {
                     con.objectData._customData["_propID"] = pos;
                 }
             }
             else
             {
                 if (e.eventData._customData != null && e.eventData._customData["_propID"] != null)
                 {
                     e.eventData._customData["_propID"] = e.eventData._customData["_propID"].AsInt + leftRight;
                 }
                 int modified = BeatmapEventContainer.EventTypeToModifiedType(e.eventData._type);
                 modified += leftRight;
                 if (modified < 0)
                 {
                     modified = 0;
                 }
                 if (modified > 15)
                 {
                     modified = 15;
                 }
                 e.eventData._type = BeatmapEventContainer.ModifiedTypeToEventType(modified);
                 e.RefreshAppearance();
                 if (e.eventData.IsRotationEvent || e.eventData._type - leftRight == MapEvent.EVENT_TYPE_LATE_ROTATION ||
                     e.eventData._type - leftRight == MapEvent.EVENT_TYPE_EARLY_ROTATION)
                 {
                     tracksManager.RefreshTracks();
                 }
             }
         }
         con.UpdateGridPosition();
         if (eventPlacement.objectContainerCollection.RingPropagationEditing)
         {
             eventPlacement.objectContainerCollection.RingPropagationEditing = eventPlacement.objectContainerCollection.RingPropagationEditing;
         }
     }
     RefreshMap();
 }
    public void UpdateLabels(bool isRingPropagation, int lanes = 16)
    {
        foreach (Transform children in LayerInstantiate.transform.parent.transform)
        {
            if (children.gameObject.activeSelf)
            {
                Destroy(children.gameObject);
            }
        }

        for (int i = 0; i < lanes; i++)
        {
            int        modified    = BeatmapEventContainer.EventTypeToModifiedType(i);
            GameObject instantiate = Instantiate(LayerInstantiate, LayerInstantiate.transform.parent);
            instantiate.SetActive(true);
            instantiate.transform.localPosition = new Vector3(isRingPropagation ? i : modified, 0, 0);
            try
            {
                TextMeshProUGUI textMesh = instantiate.GetComponentInChildren <TextMeshProUGUI>();
                if (isRingPropagation)
                {
                    textMesh.font = UtilityAsset;
                    if (i == 0)
                    {
                        textMesh.text = "All rings";
                        textMesh.font = RedAsset;
                    }
                    else
                    {
                        textMesh.text = "RING " + i.ToString();
                        if (i % 2 == 0)
                        {
                            textMesh.font = UtilityAsset;
                        }
                        else
                        {
                            textMesh.font = AvailableAsset;
                        }
                    }
                }
                else
                {
                    switch (i)
                    {
                    case 8:
                        textMesh.font = UtilityAsset;
                        textMesh.text = "Ring Rotation";
                        break;

                    case 9:
                        textMesh.font = UtilityAsset;
                        textMesh.text = "Small Ring Zoom";
                        break;

                    case 12:
                        textMesh.text = "Left Laser Speed";
                        textMesh.font = UtilityAsset;
                        break;

                    case 13:
                        textMesh.text = "Right Laser Speed";
                        textMesh.font = UtilityAsset;
                        break;

                    case 14:
                        textMesh.text = "Rotation (Include Current Time)";
                        textMesh.font = UtilityAsset;
                        break;

                    case 15:
                        textMesh.text = "Rotation (Exclude Current Time)";
                        textMesh.font = UtilityAsset;
                        break;

                    default:
                        if (LightingManagers.Length > i)
                        {
                            LightsManager customLight = LightingManagers[i];
                            textMesh.text = customLight?.name;
                            textMesh.font = AvailableAsset;
                        }
                        else
                        {
                            Destroy(textMesh);
                        }
                        break;
                    }
                }
            }
            catch { }
        }
    }
    public void UpdateLabels(bool isPropagation, int eventType, int lanes = 16)
    {
        foreach (Transform children in LayerInstantiate.transform.parent.transform)
        {
            if (children.gameObject.activeSelf)
            {
                Destroy(children.gameObject);
            }
        }

        for (int i = 0; i < lanes; i++)
        {
            int        modified    = BeatmapEventContainer.EventTypeToModifiedType(i);
            GameObject instantiate = Instantiate(LayerInstantiate, LayerInstantiate.transform.parent);
            instantiate.SetActive(true);
            instantiate.transform.localPosition = new Vector3(isPropagation ? i : modified, 0, 0);
            try
            {
                TextMeshProUGUI textMesh = instantiate.GetComponentInChildren <TextMeshProUGUI>();
                if (isPropagation)
                {
                    textMesh.font = UtilityAsset;
                    if (i == 0)
                    {
                        textMesh.text = "All Lights";
                        textMesh.font = RedAsset;
                    }
                    else
                    {
                        textMesh.text = $"{LightingManagers[eventType].name} ID {i}";
                        if (i % 2 == 0)
                        {
                            textMesh.font = UtilityAsset;
                        }
                        else
                        {
                            textMesh.font = AvailableAsset;
                        }
                    }
                }
                else
                {
                    switch (i)
                    {
                    case MapEvent.EVENT_TYPE_RINGS_ROTATE:
                        textMesh.font = UtilityAsset;
                        textMesh.text = "Ring Rotation";
                        break;

                    case MapEvent.EVENT_TYPE_RINGS_ZOOM:
                        textMesh.font = UtilityAsset;
                        textMesh.text = "Ring Zoom";
                        break;

                    case MapEvent.EVENT_TYPE_LEFT_LASERS_SPEED:
                        textMesh.text = "Left Laser Speed";
                        textMesh.font = UtilityAsset;
                        break;

                    case MapEvent.EVENT_TYPE_RIGHT_LASERS_SPEED:
                        textMesh.text = "Right Laser Speed";
                        textMesh.font = UtilityAsset;
                        break;

                    case MapEvent.EVENT_TYPE_EARLY_ROTATION:
                        textMesh.text = "Rotation (Early)";
                        textMesh.font = UtilityAsset;
                        break;

                    case MapEvent.EVENT_TYPE_LATE_ROTATION:
                        textMesh.text = "Rotation (Late)";
                        textMesh.font = UtilityAsset;
                        break;

                    default:
                        if (LightingManagers.Length > i)
                        {
                            LightsManager customLight = LightingManagers[i];
                            textMesh.text = customLight?.name;
                            textMesh.font = AvailableAsset;
                        }
                        else
                        {
                            Destroy(textMesh);
                        }
                        break;
                    }
                }
            }
            catch { }
        }
    }