private void VRTK_ControllerUIPointerEvents_ListenerExample_UIPointerElementExit(object sender, UIPointerEventArgs e)
 {
     VRTK_Logger.Info("UI Pointer exited " + e.previousTarget.name + " on Controller index [" + VRTK_ControllerReference.GetRealIndex(e.controllerReference) + "] and the state was " + e.isActive);
     if (togglePointerOnHit && GetComponent <VRTK_Pointer>())
     {
         GetComponent <VRTK_Pointer>().Toggle(false);
     }
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     if (GetComponent <VRTK_InteractableObject>() == null)
     {
         VRTK_Logger.Info("No Interactable Script");
     }
     GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(JackGrab);
 }
 private void VRTK_ControllerUIPointerEvents_ListenerExample_UIPointerElementEnter(object sender, UIPointerEventArgs e)
 {
     VRTK_Logger.Info("UI Pointer entered " + e.currentTarget.name + " on Controller index [" + VRTK_ControllerReference.GetRealIndex(e.controllerReference) + "] and the state was " + e.isActive + " ### World Position: " + e.raycastResult.worldPosition);
     if (togglePointerOnHit && GetComponent <VRTK_Pointer>())
     {
         GetComponent <VRTK_Pointer>().Toggle(true);
     }
 }
 public void HandlePointerOut(object sender, UIPointerEventArgs e)
 {
     VRTK_Logger.Info("UI Pointer exited " + e.previousTarget.name + " on Controller index [" + VRTK_ControllerReference.GetRealIndex(e.controllerReference) + "] and the state was " + e.isActive);
     if (GetComponent <VRTK_Pointer>())
     {
         GetComponent <VRTK_Pointer>().Toggle(false);
     }
 }
Example #5
0
        private void handlePush(object sender, Control3DEventArgs e)
        {
            VRTK_Logger.Info("Pushed");

            GameObject newGo = (GameObject)Instantiate(go, dispenseLocation.position, Quaternion.identity);

            Destroy(newGo, 10f);
        }
Example #6
0
        private void HandlePush(object sender, Control3DEventArgs e)
        {
            VRTK_Logger.Info("Pushed");
            var listBlocks = GetSnapDropZoneBlockGroup().GetListOfSnappedProgramBlocks();

            Debug.Log("HandlePush: list blocks count = " + listBlocks.Count);

            GetDecoder().Decode(listBlocks);
        }
Example #7
0
    // Use this for initialization
    void Start()
    {
        MaterialInit();
        if (GetComponent <VRTK_InteractableObject>() == null)
        {
            VRTK_Logger.Info("No Interactable Script");
        }

        GetComponent <VRTK_InteractableObject>().InteractableObjectUsed += new InteractableObjectEventHandler(Mortar_InteractableObjectUsed);
    }
Example #8
0
 public void Enter()
 {
     VRTK_Logger.Info("You've typed [" + input.text + "]");
     if (input.text == "420")
     {
         input.text = "Correct, you may escape now";
         input.GetComponent <Text>().color = Color.green;
     }
     input.text = "";
 }
 private void handlePush(object sender, Control3DEventArgs e)
 {
     if (e.normalizedValue > .8f)
     {
         VRTK_Logger.Info("Pushed");
         print("Button pushed");
     }
     //GameObject newGo = (GameObject)Instantiate(go, dispenseLocation.position, Quaternion.identity);
     //Destroy(newGo, 10f);
 }
Example #10
0
        private void handlePush(object sender, Control3DEventArgs e)
        {
            VRTK_Logger.Info("Pushed");
            //akce:
            //GameObject newGo = (GameObject)Instantiate(go, dispenseLocation.position, Quaternion.identity);
            //Destroy(newGo, 10f);
            stav = !stav;

            switch (typeReactor)
            {
            case TR.noneR:
                break;

            case TR.lightR:
                oeLight1.enabled = !oeLight1.enabled;
                myLed.SetActive(oeLight1.enabled);
                break;

            case TR.soundR:
                oeAudio1.SetActive(stav);
                myLed.SetActive(stav);
                break;

            case TR.toolsR:
                oeTools.SetActive(stav);
                myLed.SetActive(stav);
                break;

            case TR.leftR:
                oeToolsL.SetActive(stav);
                myLed.SetActive(stav);
                break;

            case TR.rightR:
                oeToolsR.SetActive(stav);
                myLed.SetActive(stav);
                break;

            case TR.generatorR:
                oeGenerateObject();
                break;


            default:
                Debug.Log("err reactor Type");
                break;
            }



            if (debugLog)
            {
                Debug.Log("--- oeButtonReactor " + indexData + ": " + stav);
            }
        }
Example #11
0
 public void Enter()
 {
     VRTK_Logger.Info("You've typed [" + input.text + "]");
     //send the input text to the writer to put it on a file
     outfile    = input.text;
     input.text = "";
     //Enable the writer to write **IF ALWAYS ON THERE WILL BE FREQUENT UPDATES**
     writer.SetActive(true);
     //Turn Keyboard off until next scene
     this.gameObject.SetActive(false);
 }
 private void handlePush(object sender, Control3DEventArgs e)
 {
     VRTK_Logger.Info("Pushed");
     if (lightOn)
     {
         TurnOffLightSwitch();
     }
     else
     {
         TurnOnLightSwitch();
     }
 }
Example #13
0
 // Token: 0x06001E5A RID: 7770 RVA: 0x00099C7F File Offset: 0x00097E7F
 private void DebugLogger(uint index, string action, GameObject target)
 {
     VRTK_Logger.Info(string.Concat(new object[]
     {
         "Controller on index '",
         index,
         "' is ",
         action,
         " an object named ",
         target.name
     }));
 }
Example #14
0
    // Use this for initialization
    void Start()
    {
        grabbed = false;
        if (GetComponent <VRTK_InteractableObject>() == null)
        {
            VRTK_Logger.Info("No Interactable Script");
        }


        GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed   += new InteractableObjectEventHandler(Mortar_InteractableObjectGrabbed);
        GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(Mortar_InteractableObjectUnGrabbed);
    }
Example #15
0
        private void handlePush(object sender, Control3DEventArgs e)
        {
            if (start > 0)
            {
                VRTK_Logger.Info("Pushed");
                InputToAction Script = GameObject.FindGameObjectWithTag("GameController").GetComponent <InputToAction>();
                Script.FreezeAll();
                print("pressed");
            }

            start = 1;
        }
Example #16
0
        public void AddNumber(int num)
        {
            passwordAttempt.Add(num);
            UpdateDisplay();

            string log = "";

            foreach (int i in passwordAttempt)
            {
                log += i + " ";
            }
            VRTK_Logger.Info(log);
        }
Example #17
0
    // Use this for initialization
    void Start()
    {
        pedestral = GameObject.Find("Pedestral");
        spawn     = GameObject.Find("Sphere (1)");
        t         = gameObject.transform;
        rb        = gameObject.GetComponent <Rigidbody>();

        if (GetComponent <VRTK_InteractableObject>() == null)
        {
            VRTK_Logger.Info("No Interactable Script");
        }
        GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(BowlingBallGrab);
    }
Example #18
0
        protected virtual void ValueChanged(object sender, ControllableEventArgs e)
        {
            lockData.UpdateAttempt(e.value.ToString());
            bool isAttemptCorrect = lockData.CheckAttempt();

            if (isAttemptCorrect)
            {
                // Can't seem to interact with spinControl properly when doorControl is enabled. Need to keep doorControl disabled before unlocking.
                doorControl.enabled = true;
                spinControl.enabled = false;
                openDoorSound.Play();
            }
            VRTK_Logger.Info(string.Format("Lock2_Reactor.ValueChanged {0}", e.value.ToString()));
        }
Example #19
0
 public void Enter()
 {
     VRTK_Logger.Info("You've typed [" + input.text + "]");
     if (input.text == code)
     {
         input.text = "Correct, you may escape now";
         Door.GetComponent <VRTK_InteractableObject>().isGrabbable = true;
         Door.GetComponent <Rigidbody>().isKinematic = false;
     }
     else
     {
         input.text = "";
     }
 }
Example #20
0
 // Update is called once per frame
 void Update()
 {
     if (!done)
     {
         if (gameObject.transform.position.Equals(snapped.transform.position))
         {
             VRTK_Logger.Info(gameObject.name + "Snapped");
             //Destroy(gameObject.GetComponent<Rigidbody>());
             //Destroy(gameObject.GetComponent<MeshCollider>());
             done = true;
             //AudioManager.Instance.PlayPuzzleSnapSound(gameObject);
             //PuzzleMgr.Instance.completedPieces++;
         }
     }
 }
Example #21
0
        protected virtual void FixTrackingType()
        {
#if VRTK_DEFINE_SDK_OCULUS
            if (forceOculusFloorLevel && !trackingLevelFloor)
            {
                GameObject overManagerGO = GameObject.Find("[VRTK_SDKManager]/[VRTK_SDKSetups]/Oculus/OVRCameraRig");
                if (overManagerGO != null)
                {
                    OVRManager ovrManager = overManagerGO.GetComponent <OVRManager>();
                    if (ovrManager != null)
                    {
                        ovrManager.trackingOriginType = OVRManager.TrackingOrigin.FloorLevel;
                        trackingLevelFloor            = true;
                        VRTK_Logger.Info("Forced Oculus Tracking to Floor Level");
                    }
                }
            }
#endif
        }
Example #22
0
 // Token: 0x06001E33 RID: 7731 RVA: 0x00099700 File Offset: 0x00097900
 private void DebugLogger(uint index, string button, string action, ControllerInteractionEventArgs e)
 {
     VRTK_Logger.Info(string.Concat(new object[]
     {
         "Controller on index '",
         index,
         "' ",
         button,
         " has been ",
         action,
         " with a pressure of ",
         e.buttonPressure,
         " / trackpad axis at: ",
         e.touchpadAxis,
         " (",
         e.touchpadAngle,
         " degrees)"
     }));
 }
        protected virtual void Assert(string description, bool assertion, string failure, string success = "")
        {
            if (assertion)
            {
                VRTK_Logger.Info("<color=teal><b>## [" + description + "] PASSED ##</b></color>");
            }
            else
            {
                VRTK_Logger.Info("<color=maroon><b>## [" + description + "] FAILED INSIDE [" + currentTest + "." + currentSetup + "]##</b></color>");
            }

            if (!assertion)
            {
                VRTK_Logger.Error(new System.Exception(failure));
            }
            else if (success != "")
            {
                VRTK_Logger.Info("<color=purple><i> ~~~~~> " + success + "</i></color>");
            }
        }
Example #24
0
    private void ResetPins(object sender, InteractableObjectEventArgs e)
    {
        VRTK_Logger.Info("Clicked Typewriter");
        Destroy(currentSkittle);
        currentSkittle = Instantiate(SkittlePrebaf);
        AudioManager.Instance.PinResetSound();
        StartCoroutine(ButtonToGreen());

        // If the used object is the typewriter, set the headlines active
        //for (int i = 0; i < pins.Length; i++){
        //    Destroy(pins[i]);

        //    GameObject clone = Instantiate(pinsspawn[i], GameObject.Find("Skittles_geo " + i).transform);
        //    clone.GetComponent<MeshRenderer>().enabled = true;
        //    clone.GetComponent<MeshCollider>().enabled = true;
        //    clone.GetComponent<Rigidbody>().isKinematic = false;
        //    clone.GetComponent<Rigidbody>().useGravity = true;
        //    pins[i] = clone;
        //}
    }
Example #25
0
        public bool IsAttemptCorrect()
        {
            if (passwordAttempt.Count != password.Count)
            {
                ClearDisplay();
                return(false);
            }

            bool isAttemptCorrect = true;

            for (int i = 0; i < password.Count; i++)
            {
                if (password[i] != passwordAttempt[i])
                {
                    isAttemptCorrect = false;
                    break;
                }
            }
            VRTK_Logger.Info(string.Format("Lock.Submit {0}", isAttemptCorrect));
            return(isAttemptCorrect);
        }
Example #26
0
        public void Button_Red()
        {
            VRTK_Logger.Info("Red Button Clicked");

            /*  if(cnt_red%2==0)
             * {
             *  cnt_red++;
             *  g2d1.SetActive(true);
             *  g2d2.SetActive(true);
             *  g2d3.SetActive(true);
             * }
             * else
             * {
             *  cnt_red++;
             *  g2d1.SetActive(false);
             *  g2d2.SetActive(false);
             *  g2d3.SetActive(false);
             * }
             */
            //SceneManager.LoadScene("collision");
        }
Example #27
0
        // Token: 0x06001E61 RID: 7777 RVA: 0x00099E18 File Offset: 0x00098018
        private void DebugLogger(uint index, string action, Transform target, RaycastHit raycastHit, float distance, Vector3 tipPosition)
        {
            string text  = target ? target.name : "<NO VALID TARGET>";
            string text2 = raycastHit.collider ? raycastHit.collider.name : "<NO VALID COLLIDER>";

            VRTK_Logger.Info(string.Concat(new object[]
            {
                "Controller on index '",
                index,
                "' is ",
                action,
                " at a distance of ",
                distance,
                " on object named [",
                text,
                "] on the collider named [",
                text2,
                "] - the pointer tip position is/was: ",
                tipPosition
            }));
        }
Example #28
0
        public void Button_Pink()
        {
            VRTK_Logger.Info("Pink Button Clicked");

            /* if(cnt_pinkwhole%2==0)
             * {
             *   cnt_pinkwhole++;
             *   foreach (GameObject g3d in g3d)
             *   {
             *       g3d.gameObject.SetActive(true);
             *   }
             * }
             * else
             * {
             *   foreach (GameObject g3d in g3d)
             *   {
             *       g3d.gameObject.SetActive(false);
             *   }
             *   cnt_pinkwhole++;
             * }
             */
        }
        protected virtual void MaxLimitReached(object sender, ControllableEventArgs e)
        {
            VRTK_BaseControllable senderButton = sender as VRTK_BaseControllable;

            VRTK_Logger.Info(senderButton.name + " was pushed");
        }
 private void VRTK_ControllerUIPointerEvents_ListenerExample_UIPointerElementDragEnd(object sender, UIPointerEventArgs e)
 {
     VRTK_Logger.Info("UI Pointer stopped dragging " + e.currentTarget.name + " on Controller index [" + VRTK_ControllerReference.GetRealIndex(e.controllerReference) + "] and the state was " + e.isActive + " ### World Position: " + e.raycastResult.worldPosition);
 }