protected virtual void Start() { currentPanelId = 0; soundEffect = GetComponent <AudioSource>(); if (transform.GetChild(0).gameObject.activeSelf == false) { transform.GetChild(0).gameObject.SetActive(true); } interactableObject = gameObject.transform.parent.gameObject; if (interactableObject == null || interactableObject.GetComponent <VRTK_InteractableObject>() == null) { interactableObject = gameObject.transform.parent.parent.gameObject; } if (interactableObject == null || interactableObject.GetComponent <VRTK_InteractableObject>() == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuController", "VRTK_InteractableObject", "a parent")); return; } interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsGrabbed); interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsUngrabbed); canvasObject = gameObject.transform.GetChild(0).gameObject; if (canvasObject == null || canvasObject.GetComponent <Canvas>() == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuController", "Canvas", "a child")); } }
protected virtual void Update() { if (interactableObject != null) { if (rotateTowards == null) { rotateTowards = VRTK_DeviceFinder.HeadsetTransform().gameObject; if (rotateTowards == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.COULD_NOT_FIND_OBJECT_FOR_ACTION, "PanelMenuController", "an object", "rotate towards")); } } if (isShown) { if (rotateTowards != null) { transform.rotation = Quaternion.LookRotation((rotateTowards.transform.position - transform.position) * -1, Vector3.up); } } if (isPendingSwipeCheck) { CalculateSwipeAction(); } } }
protected virtual void Start() { controllerEvents.TouchpadPressed += new ControllerInteractionEventHandler(DoTouchpadPress); canvasObject = gameObject.transform.GetChild(0).gameObject; if (canvasObject == null || canvasObject.GetComponent <Canvas>() == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuController", "Canvas", "a child")); } }
private void Start() { slider = GetComponent <Slider>(); if (slider == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuUISlider", "Slider", "the same")); return; } GetComponentInParent <PanelMenuItemController>().PanelMenuItemSwipeLeft += new PanelMenuItemControllerEventHandler(OnPanelMenuItemSwipeLeft); GetComponentInParent <PanelMenuItemController>().PanelMenuItemSwipeRight += new PanelMenuItemControllerEventHandler(OnPanelMenuItemSwipeRight); }
protected virtual void Start() { interactableObject = gameObject; if (interactableObject == null || interactableObject.GetComponent <VRTK_InteractableObject>() == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "ElevatorCommand", "VRTK_InteractableObject", "a parent")); return; } interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsGrabbed); interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsUngrabbed); GetComponent <VRTK_InteractableObject>().ToggleHighlight(false); }
// Token: 0x06001EA8 RID: 7848 RVA: 0x0009BDA0 File Offset: 0x00099FA0 private void Start() { this.slider = base.GetComponent <Slider>(); if (this.slider == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, new object[] { "PanelMenuUISlider", "Slider", "the same" })); return; } base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeLeft += this.OnPanelMenuItemSwipeLeft; base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeRight += this.OnPanelMenuItemSwipeRight; }
private void Start() { gridLayoutGroup = GetComponent <GridLayoutGroup>(); if (gridLayoutGroup == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuUIGrid", "GridLayoutGroup", "the same")); return; } GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeTop += new PanelMenuItemControllerEventHandler(OnPanelMenuItemSwipeTop); GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeBottom += new PanelMenuItemControllerEventHandler(OnPanelMenuItemSwipeBottom); GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeLeft += new PanelMenuItemControllerEventHandler(OnPanelMenuItemSwipeLeft); GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeRight += new PanelMenuItemControllerEventHandler(OnPanelMenuItemSwipeRight); GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemTriggerPressed += new PanelMenuItemControllerEventHandler(OnPanelMenuItemTriggerPressed); SetGridLayoutItemSelectedState(selectedIndex); }
// Token: 0x06001E9D RID: 7837 RVA: 0x0009BA68 File Offset: 0x00099C68 private void Start() { this.gridLayoutGroup = base.GetComponent <GridLayoutGroup>(); if (this.gridLayoutGroup == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, new object[] { "PanelMenuUIGrid", "GridLayoutGroup", "the same" })); return; } base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeTop += this.OnPanelMenuItemSwipeTop; base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeBottom += this.OnPanelMenuItemSwipeBottom; base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeLeft += this.OnPanelMenuItemSwipeLeft; base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemSwipeRight += this.OnPanelMenuItemSwipeRight; base.GetComponentInParent <VRTK_PanelMenuItemController>().PanelMenuItemTriggerPressed += this.OnPanelMenuItemTriggerPressed; this.SetGridLayoutItemSelectedState(this.selectedIndex); }
protected virtual void Start() { interactableObject = gameObject.transform.parent.gameObject; if (interactableObject == null || interactableObject.GetComponent <VRTK_InteractableObject>() == null) { //VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuController", "VRTK_InteractableObject", "a parent")); //return; interactableObject = controllerEvents.gameObject; isGrabbed = true; BindControllerEvents(); } else { interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsGrabbed); interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsUngrabbed); } canvasObject = gameObject.transform.GetChild(0).gameObject; if (canvasObject == null || canvasObject.GetComponent <Canvas>() == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "PanelMenuController", "Canvas", "a child")); } }
protected virtual void Start() { statutDesc = false; currentPanelId = 0; presentationPanel = descPanel.transform.parent.gameObject; allPanelMenuItemController = new List <VRTK_PanelMenuItemController>(); for (int i = 0; i < descPanel.transform.GetChild(0).gameObject.transform.childCount; i++) { allPanelMenuItemController.Add(descPanel.transform.GetChild(0).gameObject.transform.GetChild(i).gameObject.GetComponent <VRTK_PanelMenuItemController>()); } interactableObject = gameObject; if (interactableObject == null || interactableObject.GetComponent <VRTK_InteractableObject>() == null) { VRTK_Logger.Warn(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "ElevatorCommand", "VRTK_InteractableObject", "a parent")); return; } interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectGrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsGrabbed); interactableObject.GetComponent <VRTK_InteractableObject>().InteractableObjectUngrabbed += new InteractableObjectEventHandler(DoInteractableObjectIsUngrabbed); }