Esempio n. 1
0
    /// <summary>
    /// Start Function, initialize propreties and select first Button (having no purpose).
    /// </summary>
    void Start()
    {
        MenuHand     = VRHand.oppositeOf(MGR_VRControls.mainHand);
        SwitchButton = (MenuHand == VRHand.Hand.RIGHT) ? VRButton.Code.B : VRButton.Code.Y;

        transform.SetParent(MenuHand == VRHand.Hand.RIGHT ?
                            MGR_VRControls.get.RightHand.transform : MGR_VRControls.get.LeftHand.transform);
        transform.localPosition = new Vector3(0, .25f, 0);

        Actions = GetComponentsInChildren <Button>();
        foreach (Button btn in Actions)
        {
            btn.image.color = UnselectedColor;
        }
        LoadButton(0);

        SavedPlayerPosition = VRUserController.main.transform.position;

        setActivaton(false);
    }
Esempio n. 2
0
    /// <summary>
    /// Start Function, initialize propreties, and inputs, and make first selection.
    /// </summary>
    void Start()
    {
        generatorInstance = GetComponentInChildren <InventoryGenerator>();

        InventoryHand = MGR_VRControls.mainHand;
        SwitchButton  = (InventoryHand == VRHand.Hand.RIGHT) ? VRButton.Code.B : VRButton.Code.Y;

        transform.SetParent(InventoryHand == VRHand.Hand.RIGHT ?
                            MGR_VRControls.get.RightHand.transform : MGR_VRControls.get.LeftHand.transform);
        transform.localPosition = new Vector3(0, .25f, 0);
        generatorInstance.gameObject.SetActive(CurrentInventoryState);

        tInvSize = generatorInstance.invContent.Count;

        // First Select
        switch (MGR_VRControls.mainHand)
        {
        case VRHand.Hand.LEFT:
            LeftHandIndex  = 0;
            RightHandIndex = 1;
            break;

        case VRHand.Hand.RIGHT:
            RightHandIndex = 0;
            LeftHandIndex  = 1;
            break;

        default: break;
        }
        ComputeSelection(MGR_VRControls.get.RightHand, MGR_VRControls.get.LeftHand);

        generatorInstance.holdOn(0, MGR_VRControls.get.primary.handColor);
        generatorInstance.holdOn(1, MGR_VRControls.get.secondary.handColor);

        MGR_VRControls.get.primary.LateStart();
        MGR_VRControls.get.secondary.LateStart();
    }