Ejemplo n.º 1
0
    private void UpdatePointerInfo()
    {
        if (NoteCurser == null)
        {
            if (PointerInfo.gameObject.activeInHierarchy)
            {
                PointerInfo.gameObject.SetActive(false);
            }
            return;
        }
        if (!NoteCurser.activeInHierarchy)
        {
            if (PointerInfo.gameObject.activeInHierarchy)
            {
                PointerInfo.gameObject.SetActive(false);
            }
            return;
        }
        if (!PointerInfo.gameObject.activeInHierarchy)
        {
            PointerInfo.gameObject.SetActive(true);
        }
        Vector2 MouseInTunerWindow = LimMousePosition.MousePositionInWindow(TunerWindowRect);

        PointerInfo.anchoredPosition = CalculatePointerInfoPosition(MouseInTunerWindow);
        PointerInfoText.text         = string.Format("{0} : {1}\n{2} : {3}\n{4} : {5}", LimLanguageManager.TextDict["ClickToCreate_Timing"], NoteCursorTiming, LimLanguageManager.TextDict["ClickToCreate_Degree"],
                                                     ClampedDegree(NoteCursorDegree), LimLanguageManager.TextDict["ClickToCreate_Deltatime"], DeltaTimeBetweenSelected());
    }
Ejemplo n.º 2
0
    private void DrawBoxSelectionArea()
    {
        if (Input.GetMouseButtonUp(0))
        {
            BoxSelectionPanel.sizeDelta = new Vector2();
            _ShouldDraw = false;
        }
        Vector2 MousePositionInWindow = LimMousePosition.MousePositionInWindow(UsingWindow);

        if (Input.GetMouseButtonDown(0) && LimMousePosition.IsMouseOverWindow(UsingWindow))
        {
            BoxSelectionPanel.sizeDelta        = new Vector2();
            BoxSelectionPanel.anchoredPosition = new Vector2(MousePositionInWindow.x, MousePositionInWindow.y);
            _AnchorPosition = BoxSelectionPanel.anchoredPosition;
            _ShouldDraw     = true;
        }
        if (!_ShouldDraw)
        {
            return;
        }
        if (Input.GetMouseButton(0) && LimMousePosition.IsMouseOverWindow(UsingWindow))
        {
            BoxSelectionPanel.sizeDelta        = new Vector2(Mathf.Abs(MousePositionInWindow.x - _AnchorPosition.x), Mathf.Abs(_AnchorPosition.y - MousePositionInWindow.y));
            BoxSelectionPanel.anchoredPosition = new Vector2(MousePositionInWindow.x > _AnchorPosition.x ? _AnchorPosition.x : MousePositionInWindow.x,
                                                             _AnchorPosition.y > MousePositionInWindow.y ? _AnchorPosition.y : MousePositionInWindow.y);
        }
    }
Ejemplo n.º 3
0
    private void UpdateNoteCurserTransformAndDetectCreate()
    {
        if (NoteCurser == null)
        {
            return;
        }
        Vector3 MousePosition = LimMousePosition.MousePosition;
        Vector3 TunerPosition = new Vector3
        {
            x = MousePosition.x - TunerWindowRect.anchoredPosition.x,
            y = TunerWindowRect.sizeDelta.y + (MousePosition.y - TunerWindowRect.anchoredPosition.y)
        };
        Vector3 Position = TunerCamera.ScreenToWorldPoint(new Vector3(TunerPosition.x, TunerPosition.y, -TunerCamera.transform.position.y));
        float   Distance = Vector3.Distance(Position, new Vector3());

        if (!UpdateNoteCurserActive(Distance))
        {
            return;
        }
        float UnEasedPercent = CalculateUnEasedPercent(Distance / 10) * 100;
        float Time           = CalculateCurserTime(UnEasedPercent);

        if (float.IsNaN(Time))
        {
            if (NoteCurser.activeInHierarchy)
            {
                NoteCurser.SetActive(false);
            }
            return;
        }
        Time = CalculateAttachToBeatlineTime(Time);
        float Degree = CalculateCurserDegree(Position);

        Degree = CalculateAttachToAnglelineDegree(Degree);
        float Percent = CalculateEasedPercent(CalculateMovePercent(Time));

        NoteCurser.transform.rotation   = Quaternion.Euler(new Vector3(90, Degree, 0));
        NoteCurser.transform.position   = new Vector3(-Percent / 10 * Mathf.Sin(Degree * Mathf.Deg2Rad), 0, -Percent / 10 * Mathf.Cos(Degree * Mathf.Deg2Rad));
        NoteCurser.transform.localScale = new Vector3(Percent / 100, Percent / 100, 0);
        NoteCursorTiming = Time;
        NoteCursorDegree = Degree - TunerManager.CameraManager.CurrentRotation;
        if (Distance < 10)
        {
            if (Input.GetMouseButtonDown(0) && LimMousePosition.IsMouseOverWindow(TunerWindowRect))
            {
                CreateNoteAtCurser(NoteCursorTiming, NoteCursorDegree);
            }
        }
    }