// Update is called once per frame
 void Update()
 {
     if (vrtk_ControllerEvents.IsButtonPressed(VRTK_ControllerEvents.ButtonAlias.TriggerPress) &&
         !uiTouched && tempTarget != null && tempTargetTransform != null)
     {
         target          = tempTarget;
         targetTransform = tempTargetTransform;
         targetName      = target.name;
         SetHeaderText();
         UpdateInputField();
         if (panelManager.currentPanelName != "inspector")
         {
             panelManager.ChangePanelTo("inspector");
             Debug.Log("Change Panel to Inspector");
         }
     }
     if (target != null)
     {
         if (transformGizmos.isTransforming)
         {
             UpdateInputField();
         }
         if (!interactGrab.IsGrabButtonPressed())
         {
             UpdateTarget();
         }
         else
         {
             UpdateInputField();
         }
     }
 }
 public void HandleClick()
 {
     if (panelMode == "project")
     {
         fs.ChangeDirectory("./");
     }
     else if (panelMode == "inspector")
     {
         panelManager.ChangePanelTo("project");
     }
 }
Exemple #3
0
 void HandleClick()
 {
     if (fs == null)
     {
         Debug.LogError("File system not found!");
     }
     else if (!isDirectory)
     {
         if (fileAbsoluteDirectory.Contains(".prefab"))
         {
             Debug.Log("Prefab directory: " + fileRelativeDirectory);
             Object     targetObject = (GameObject)AssetDatabase.LoadAssetAtPath <Object>(fileRelativeDirectory);
             GameObject target       = Instantiate(targetObject) as GameObject;
             target.AddComponent <VRTK_InteractableObject>();
             target.GetComponent <VRTK_InteractableObject>().isGrabbable = true;
             target.AddComponent <VRTK_AxisScaleGrabAction>();
             inspector.SetTarget(target);
             VRTK_ObjectAutoGrab objectAutoGrab = inspector.controller.GetComponent <VRTK_ObjectAutoGrab>();
             grabManager.SetAutoGrab(true);
             objectAutoGrab.objectToGrab = target.GetComponent <VRTK_InteractableObject>();
             objectAutoGrab.enabled      = true;
             panelManager.ChangePanelTo("inspector");
         }
         else if (fileAbsoluteDirectory.Contains(".unity"))
         {
             Debug.Log("Path: " + fileRelativeDirectory);
             sceneManager.LoadScene(fileRelativeDirectory);
             //sceneManager.LoadScene("VR_Interior_Design");
         }
         else
         {
             Debug.LogError("Can't open file or directory!");
         }
     }
     else
     {
         fs.ChangeDirectory(fileAbsoluteDirectory);
     }
 }