Esempio n. 1
0
    public void DrawLineEvent(EditorAction eItem, GeneralEvent generalEvent, bool is_double_event = false)
    {
        EventPanel     ePanel     = EventPanels.Find(x => x.generalEvent == generalEvent);
        EventPanelLine ePanelLine = ePanel.GetComponent <EventPanelLine>();

        if (ePanel != null)
        {
            float scale = (eItem.line_event.position.y - ePanelLine.line_in.position.y) * 0.9965f;
            eItem.line_event.localScale = new Vector3(1, scale, 1);
            int step = 0;
            //print(" --generalEvent = " + generalEvent);
            if (scale > 0)
            {
                if (linesEventPanel.ContainsKey(ePanelLine))
                {
                    step = linesEventPanel[ePanelLine];
                }
                else
                {
                    step = (!is_double_event) ? FindEmptyStep() : eItem.level_line;
                    linesStep.Add(step);
                    linesEventPanel[ePanelLine]   = step;
                    eItem.level_line              = step;
                    ePanelLine.line_in.localScale = new Vector3((step + 1) * 2f, ePanelLine.line_in.localScale.y, 1);
                }
            }
            else
            {
                step             = FindMaxLevel() + 1;
                eItem.level_line = step;
                ePanelLine.line_in.localScale = new Vector3((step + 1) * 2f, ePanelLine.line_in.localScale.y, 1);
            }

            scale = (step + 1) * 2f;
            if (!is_double_event)
            {
                eItem.line_out.localScale = new Vector3(scale * eItem.line_out.localScale.x, 1, 1);
            }
            //print(eItem.line_out.localScale);
            eItem.line_event.localScale = new Vector3(1 / eItem.line_out.localScale.x, eItem.line_event.localScale.y, 1);
        }
    }