//Handle the Click event protected virtual void HandleClick() { inventorySpt = GetComponent<VRInteractiveItem>().inventoryScript; Debug.Log(inventorySpt.retrieveObjectFromInventory(inventorySpt.activeItem).name); if (Input.GetButtonDown("aButton") && inventorySpt.retrieveObjectFromInventory(inventorySpt.activeItem).name.Contains(gateItemName)) { clickSuccess(); } }
//Handle the Down event protected virtual void HandleDown() { inventorySpt = GetComponent<VRInteractiveItem>().inventoryScript; selectionRadial = GetComponent<VRInteractiveItem>().radial; // User must press A to interact with the object, negates the case of user holding A previous to interaction if (Input.GetButtonDown("aButton") && inventorySpt.retrieveObjectFromInventory(inventorySpt.activeItem).name.Contains(gateItemName)) { holding = true; selectionRadial.enabled = true; Debug.Log("Show down state"); //m_Renderer.material = m_DownMaterial; } if (holding) { selectionRadial.fillAmount = timer / holdTime; timer += Time.deltaTime; if (timer >= holdTime || holdTime == 0) { selectionRadial.enabled = false; holdSuccess(); } } //START HERE FOR RADIAL FADING if (!holding) { selectionRadial.fillAmount = 0; selectionRadial.enabled = false; timer = 0; } }