private void Start() { radialMenu = GetComponentInChildren <VRTK_RadialMenu>(); if (!radialMenu) { Debug.Log("This ControllerSceneMenu object doesn't have a radial menu attached!"); return; } foreach (var button in radialMenu.buttons) { button.OnClick.AddListener(Hide); } var controllerEvents = GetComponentInParent <VRTK_ControllerEvents>(); pointer = GetComponentInParent <VRTK_Pointer>(); if (controllerEvents) { controllerEvents.ButtonTwoPressed += Controller_ButtonTwoPressed; } Hide(); }
/// <summary> /// Observable FireHapticPulse event /// </summary> /// <param name="events"></param> /// <returns></returns> public static IObservable <Single> FireHapticPulseAsObservable(this VRTK_RadialMenu events) { return(Observable.FromEvent <HapticPulseEventHandler, Single>( h => h.Invoke, h => events.FireHapticPulse += h, h => events.FireHapticPulse -= h)); }
void Start() { bagPackLid = gameObject.transform.GetComponentInChildren <BackPackLid>(); myText = gameObject.transform.GetComponentInChildren <TextMeshPro>(); rightHandRadialMenu = FindObjectOfType <RightHandRadialMenuPanel>().gameObject.GetComponent <VRTK_RadialMenu>(); radialMenuController = FindObjectOfType <RadialMenuController>(); radialMenuButton = new VRTK_RadialMenu.RadialMenuButton(); }
/** * Called at object's initialization */ void Awake() { // Register callback to ParaView Object Loaded event Globals.ParaviewObjectLoadedCallbacks += OnParaviewObjectLoaded; Globals.ParaviewObjectUnloadedCallbacks += OnParaviewObjectUnloaded; // Save references vrtkRadialMenu = GetComponentInChildren <VRTK_RadialMenu>(); }
// Use this for initialization void Awake() { if (radialMenu == null) { radialMenu = transform.parent.Find("RadialMenu/RadialMenuUI/Panel").GetComponent <VRTK_RadialMenu>(); } // Look for controller tip on awake if (controllerTip == null) { controllerTip = transform.parent.transform.Find("Model/tip/attach"); } }
private void Start() { menu = GetComponent <VRTK_RadialMenu>(); _playerHandAnimation = menu.GetComponentInParent <PlayerHandAnimation>(); _tools = playerHand.transform.Find("Tools").gameObject; _playerToolsBase = menu.GetComponentInParent <PlayerHandController>().playerToolsBase; listBackpack = Backpack.Instance.listBackpack; dicBackPack = Backpack.Instance.dicBackpack; for (int i = 0; i < listBackpack.Count; i++) { //if (dicBackpack.(i)) { menu.AddButton(listBackpack[i].button); } } }
void Start() { if (radialMenu == null) { radialMenu = transform.parent.Find("RadialMenu/RadialMenuUI/Panel").GetComponent <VRTK_RadialMenu>(); if (radialMenu == null) { Debug.LogError("Could not find radial menu in parent"); } } // Look for controller tip on start if (controllerTip == null) { controllerTip = transform.parent.transform.Find("Model/tip/attach"); } if (radialMenu != null) { // ERROR TESTING - REINCORPORATE //for (int i = 0; i < buttons.Length; i++) //{ // Texture2D newTexture = AssetPreview.GetAssetPreview(buttons[i]); // Debug.Log("Create button preview for " + buttons[i].name); // if (newTexture == null) // { // Debug.LogError("Null Texture created for RadialMenu button"); // } // else // { // Sprite newSprite = Sprite.Create(newTexture, new Rect(0, 0, newTexture.width, newTexture.height), new Vector2(0.5f, 0.5f)); // radialMenu.buttons[i].ButtonIcon = newSprite; // Object objClone = buttons[i]; // radialMenu.buttons[i].OnClick.AddListener(delegate { spawnObj(objClone); }); // } //} } }
/** * Called at object's initialization */ protected override void Awake() { base.Awake(); behaviour = GetComponent <ControllerBehaviour>(); radialMenu = transform.FindDeepChild("RadialMenuUI/Panel").GetComponent <VRTK_RadialMenu>(); }