Beispiel #1
0
    void Update()
    {
        if (activeMouseHandler == null)
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (Input.GetKey(KeyCode.LeftAlt))
            {
                SetCurrentHandler(orbitCamera);
            }
            else
            {
                if (activeMouseHandler == orbitCamera)
                {
                    activeMouseHandler = lastMouseHandler;
                }
            }

            activeMouseHandler.OnMouseLeftClickDown();
        }
        if (Input.GetMouseButton(0))
        {
            activeMouseHandler.OnMouseLeftClick();
        }
        if (Input.GetMouseButtonUp(0))
        {
            activeMouseHandler.OnMouseLeftClickUp();
        }
    }