Beispiel #1
0
 public void OnSetPick()
 {
     colorOp = ColorOp.Pick;
     colorizeButton.Checked        = false;
     pickButton.Checked            = true;
     updateSelectionButton.Checked = false;
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Trigger, Tooltips.Action.Push, "Pick Material");
 }
Beispiel #2
0
 public override void SetTooltips()
 {
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Primary, Tooltips.Action.Push, "Pick Material");
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Joystick, Tooltips.Action.HoldHorizontal, "Brush Size");
     Tooltips.SetVisible(VRDevice.PrimaryController, Tooltips.Location.Trigger, false);
     Tooltips.SetVisible(VRDevice.PrimaryController, Tooltips.Location.Grip, false);
     Tooltips.SetVisible(VRDevice.PrimaryController, Tooltips.Location.Secondary, false);
 }
Beispiel #3
0
 public void OnSetUpdateSelection()
 {
     colorOp = ColorOp.UpdateSelection;
     colorizeButton.Checked        = false;
     pickButton.Checked            = false;
     updateSelectionButton.Checked = true;
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Trigger, Tooltips.Action.Push, "Select Object");
     UpdateMaterial();
 }
Beispiel #4
0
 public override void SetTooltips()
 {
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Trigger, Tooltips.Action.HoldPush, "Draw");
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Secondary, Tooltips.Action.Push, "Switch Tool");
     Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Joystick, Tooltips.Action.HoldHorizontal, "Brush Size");
     Tooltips.SetVisible(VRDevice.PrimaryController, Tooltips.Location.Primary, false);
     Tooltips.SetVisible(VRDevice.PrimaryController, Tooltips.Location.Grip, false);
     // TODOGRASS: tooltips for Grass.
 }
Beispiel #5
0
        public override void Init(Transform rigTransform, Transform worldTransform, Transform leftHandleTransform, Transform rightHandleTransform, Transform pivotTransform, Transform cameraTransform, Transform parametersTransform)
        {
            base.Init(rigTransform, worldTransform, leftHandleTransform, rightHandleTransform, pivotTransform, cameraTransform, parametersTransform);

            // Create tooltips
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Joystick, "Move Turn");
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Grip, Tooltips.Action.HoldPush, "Grip World");

            usedControls = UsedControls.LEFT_GRIP | UsedControls.LEFT_JOYSTICK;
        }
Beispiel #6
0
        public override void Init(Transform rigTransform, Transform worldTransform, Transform leftHandleTransform, Transform rightHandleTransform, Transform pivotTransform, Transform cameraTransform, Transform parametersTransform)
        {
            base.Init(rigTransform, worldTransform, leftHandleTransform, rightHandleTransform, pivotTransform, cameraTransform, parametersTransform);

            cameraForward = Camera.main.transform.TransformDirection(Vector3.forward).normalized;
            // Create tooltips
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Joystick, "Altitude / Strafe");

            usedControls = UsedControls.LEFT_JOYSTICK | UsedControls.RIGHT_JOYSTICK;

            Transform drone = parameters.Find("Drone");

            drone.gameObject.SetActive(true);
        }
Beispiel #7
0
        public override void Init(Transform rigTransform, Transform worldTransform, Transform leftHandleTransform, Transform rightHandleTransform, Transform pivotTransform, Transform cameraTransform, Transform parametersTransform)
        {
            base.Init(rigTransform, worldTransform, leftHandleTransform, rightHandleTransform, pivotTransform, cameraTransform, parametersTransform);
            controller         = rigTransform.GetComponent <CharacterController>();
            controller.enabled = true;

            cameraForward = Camera.main.transform.TransformDirection(Vector3.forward).normalized;
            // Create tooltips
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Joystick, "Altitude / Strafe");
            usedControls = UsedControls.LEFT_JOYSTICK | UsedControls.RIGHT_JOYSTICK | UsedControls.RIGHT_PRIMARY;

            Transform fps = parametersTransform.Find("FPS");

            fps.gameObject.SetActive(true);
        }
Beispiel #8
0
        void Start()
        {
            if (!VRInput.TryGetDevices())
            {
                Debug.LogWarning("PlayerController cannot VRInput.TryGetDevices().");
            }

            if (vrCamera == null)
            {
                Debug.LogWarning("Cannot find 'VRCamera' game object");
            }
            if (paletteController == null)
            {
                Debug.LogWarning("Cannot find 'PaletteController' game object");
            }
            if (toolsController == null)
            {
                Debug.LogWarning("Cannot find 'ToolsController' game object");
            }
            if (pivot == null)
            {
                Debug.LogWarning("Cannot find 'Pivot' game object");
            }

            if (ray != null)
            {
                ray.gameObject.SetActive(false);
            }

            if (teleport != null)
            {
                teleport.gameObject.SetActive(false);
            }

            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Trigger, Tooltips.Action.HoldPush, "Open Palette");
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Primary, Tooltips.Action.Push, "Undo");
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Secondary, Tooltips.Action.Push, "Redo");
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Push, "Reset");
            IsInLobby = true;  // hide tooltips

            OnChangeNavigationMode("BiManual");

            rightHanded = world.Find("Avatars");

            StartCoroutine(SendPlayerTransform());
        }
        public override void Init(Transform rigTransform, Transform worldTransform, Transform leftHandleTransform, Transform rightHandleTransform, Transform pivotTransform, Transform cameraTransform, Transform parametersTransform)
        {
            base.Init(rigTransform, worldTransform, leftHandleTransform, rightHandleTransform, pivotTransform, cameraTransform, parametersTransform);

            // Create tooltips
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Joystick, "Target / Turn");

            usedControls = UsedControls.LEFT_JOYSTICK;

            Transform teleportParameters = parameters.Find("Teleport");

            teleportParameters.gameObject.SetActive(true);

            UICheckbox lockHeight = teleportParameters.Find("LockHeight").GetComponent <UICheckbox>();

            lockHeight.Checked = options.lockHeight;
        }
Beispiel #10
0
        public override void Init(Transform rigTransform, Transform worldTransform, Transform leftHandleTransform, Transform rightHandleTransform, Transform pivotTransform, Transform cameraTransform, Transform parametersTransform)
        {
            base.Init(rigTransform, worldTransform, leftHandleTransform, rightHandleTransform, pivotTransform, cameraTransform, parametersTransform);

            // reset rig rotation
            Vector3   up      = Vector3.up;
            Vector3   right   = Vector3.Cross(up, rig.forward).normalized;
            Vector3   forward = Vector3.Cross(right, Vector3.up).normalized;
            Matrix4x4 m       = new Matrix4x4(right, up, forward, new Vector4(0, 0, 0, 1));

            rig.localRotation = m.rotation;

            lineUI.Show(false);

            // Create tooltips
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Grip, Tooltips.Action.HoldPush, "Grip World");

            usedControls = UsedControls.LEFT_GRIP | UsedControls.RIGHT_GRIP;
        }
Beispiel #11
0
        public override void Init(Transform rigTransform, Transform worldTransform, Transform leftHandleTransform, Transform rightHandleTransform, Transform pivotTransform, Transform cameraTransform, Transform parametersTransform)
        {
            base.Init(rigTransform, worldTransform, leftHandleTransform, rightHandleTransform, pivotTransform, cameraTransform, parametersTransform);

            // Create tooltips
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Joystick, "Turn");
            Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Grip, Tooltips.Action.HoldPush, "Grip Object");
            // TODO: find a way to reach the current right_controller (via GlobalState???)

            usedControls = UsedControls.LEFT_GRIP | UsedControls.LEFT_JOYSTICK | UsedControls.RIGHT_JOYSTICK;

            // Activate Panel and set initial slider values.
            Transform orbitPanel = parametersTransform.Find("Orbit");

            if (orbitPanel != null)
            {
                orbitPanel.gameObject.SetActive(true);
                UISlider moveSpeedSlider = orbitPanel.Find("MoveSpeed")?.GetComponent <UISlider>();
                if (moveSpeedSlider != null)
                {
                    moveSpeedSlider.Value = moveSpeed;
                }
                UISlider scaleSpeedSlider = orbitPanel.Find("ScaleSpeed")?.GetComponent <UISlider>();
                if (scaleSpeedSlider)
                {
                    scaleSpeedSlider.Value = scaleSpeed;
                }
                UISlider rotateSpeedSlider = orbitPanel.Find("RotateSpeed")?.GetComponent <UISlider>();
                if (rotateSpeedSlider)
                {
                    rotateSpeedSlider.Value = rotationalSpeed;
                }
            }

            // Activate the ray.
            if (ray != null)
            {
                ray.gameObject.SetActive(true);
                ray.SetDefaultColor(); // TODO: does not seem to work.
            }
        }
Beispiel #12
0
        public void HandleCommonTooltipsVisibility()
        {
            if (options.currentNavigationMode == null)
            {
                return;
            }

            if (IsCompatibleWithReset(options.currentNavigationMode))
            {
                Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Joystick, Tooltips.Action.Push, "Reset", !isInLobby);
            }
            else
            {
                Tooltips.SetVisible(VRDevice.SecondaryController, Tooltips.Location.Joystick, false);
            }

            if (IsCompatibleWithPalette(options.currentNavigationMode))
            {
                Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Trigger, Tooltips.Action.Push, "Open Palette", !isInLobby);
            }
            else
            {
                Tooltips.SetVisible(VRDevice.SecondaryController, Tooltips.Location.Trigger, false);
            }

            if (IsCompatibleWithUndoRedo(options.currentNavigationMode))
            {
                Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Primary, Tooltips.Action.Push, "Undo", !isInLobby);
                Tooltips.SetText(VRDevice.SecondaryController, Tooltips.Location.Secondary, Tooltips.Action.Push, "Redo", !isInLobby);
            }
            else
            {
                Tooltips.SetVisible(VRDevice.SecondaryController, Tooltips.Location.Primary, false);
                Tooltips.SetVisible(VRDevice.SecondaryController, Tooltips.Location.Secondary, false);
            }
        }
Beispiel #13
0
        protected override void Awake()
        {
            base.Awake();

            if (!panel)
            {
                Debug.LogWarning("You forgot to give the Camera Panel to the Camera Tool.");
            }
            else
            {
                focalSlider                  = panel.Find("Focal");
                focusSlider                  = panel.Find("Focus");
                apertureSlider               = panel.Find("Aperture");
                enableDepthOfFieldCheckbox   = panel.Find("EnableDepthOfField").gameObject.GetComponent <UICheckbox>();
                showCameraFeedbackCheckbox   = panel.Find("ShowFeedback").gameObject.GetComponent <UICheckbox>();
                feedbackPositionningCheckbox = panel.Find("Feedback").gameObject.GetComponent <UICheckbox>();
                showDopesheetCheckbox        = panel.Find("ShowDopesheet").gameObject.GetComponent <UICheckbox>();
                showShotManagerCheckbox      = panel.Find("ShowShotManager").gameObject.GetComponent <UICheckbox>();
                showCameraPreviewCheckbox    = panel.Find("ShowCameraPreview").gameObject.GetComponent <UICheckbox>();
                showCameraFrustumCheckbox    = panel.Find("ShowFrustum").gameObject.GetComponent <UICheckbox>();
            }

            if (!dopesheetHandle)
            {
                Debug.LogWarning("You forgot to give the Dopesheet to the Camera Tool.");
            }
            else
            {
                //dopesheet = dopesheetHandle.GetComponentInChildren<Dopesheet>();
                dopesheetHandle.localScale = Vector3.zero; // si tous les tools ont une ref sur la dopesheet, qui la cache au demarrage? ToolsUIManager?
                dopesheetHandle.position   = Vector3.zero;
            }

            if (!shotManagerHandle)
            {
                Debug.LogWarning("You forgot to give the Shot Manager to the Camera Tool.");
            }
            else
            {
                shotManagerHandle.localScale = Vector3.zero; // si tous les tools ont une ref sur le shot manager, qui la cache au demarrage? ToolsUIManager?
                shotManagerHandle.position   = Vector3.zero;
            }

            if (!cameraPreviewHandle)
            {
                Debug.LogWarning("You forgot to give the CameraPreview to the Camera Tool.");
            }
            else
            {
                cameraPreviewWindow            = cameraPreviewHandle.GetComponentInChildren <CameraPreviewWindow>();
                cameraPreviewHandle.localScale = Vector3.zero;
                cameraPreviewHandle.position   = Vector3.zero;
            }


            Init();

            // Create tooltips
            SetTooltips();
            Tooltips.SetText(VRDevice.PrimaryController, Tooltips.Location.Joystick, Tooltips.Action.HoldVertical, "Zoom");

            // Camera list
            GlobalState.ObjectAddedEvent.AddListener(OnCameraAdded);
            GlobalState.ObjectRemovedEvent.AddListener(OnCameraRemoved);
            GlobalState.ObjectRenamedEvent.AddListener(OnCameraRenamed);
            SceneManager.clearSceneEvent.AddListener(OnClearScene);
            if (null != cameraList)
            {
                cameraList.ItemClickedEvent += OnSelectCameraItem;
            }
            cameraItemPrefab = Resources.Load <GameObject>("Prefabs/UI/CameraItem");
        }