Ejemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            var position = Input.mousePosition;

            position.z = Distance;

            var worldPosition = Camera.main.ScreenToWorldPoint(position);

            if (Input.GetButtonDown(TriggerName))
            {
                var rotation = Camera.main.transform.rotation;
                if (AlignToViewsphere)
                {
                    Debug.LogWarning(gameObject.name + " - PieMenu_MouseControl::Update(): AlignToViewsphere Not Implemented.");
                }

                Menu.Show(worldPosition, Camera.main.transform.forward);
            }

            if (Input.GetButtonUp(TriggerName))
            {
                Menu.Hide();
            }

            if (Menu.Visible)
            {
                Menu.UpdateCursor(worldPosition);
            }
        }
Ejemplo n.º 2
0
        private void TrackedController_MenuButtonClicked(object sender, ClickedEventArgs e)
        {
            var position = TrackedController.transform.position;

            position += TrackedController.transform.forward * Distance;

            var forward = Camera.main.transform.forward;

            if (AlignToViewsphere)
            {
                forward = (position - Camera.main.transform.position).normalized;
            }

            Menu.Show(position, forward);
        }