private void SetPlayerPresence()
 {
     if (pp == null)
     {
         pp = GetComponent <VRTK_PlayerPresence>();
     }
 }
コード例 #2
0
 private void Awake()
 {
     if (this.GetComponent <VRTK_PlayerPresence>())
     {
         playerPresence = this.GetComponent <VRTK_PlayerPresence>();
     }
     else
     {
         Debug.LogError("The VRTK_TouchpadWalking script requires the VRTK_PlayerPresence script to be attached to the [CameraRig]");
     }
 }
コード例 #3
0
    private void Start()
    {
        startScale = transform.localScale;

        playerPresence = GetComponent <VRTK_PlayerPresence>();
        gravityMod     = GetComponent <Alice_gravity>();
        audioSource    = GetComponent <AudioSource>();
        findButton();

        pointerThickness = pointer.pointerThickness;
        pointerLength    = pointer.pointerLength;

        SetSize(Player.Sizes.Normal);
        ResizePointer();
        gravityMod.SetScale(Player.currentSize);
    }
コード例 #4
0
    private void Awake()
    {
        if (GetComponent <VRTK_PlayerPresence>())
        {
            playerPresence = GetComponent <VRTK_PlayerPresence>();
        }
        else
        {
            Debug.LogError("The VRTK_TouchpadWalking script requires the VRTK_PlayerPresence script to be attached to the [CameraRig]");
            return;
        }

        //註冊事件
        touchpadAxisChanged = new ControllerInteractionEventHandler(DoTouchpadAxisChanged);
        touchpadUntouched   = new ControllerInteractionEventHandler(DoTouchpadTouchEnd);

        controllerManager = GetComponent <SteamVR_ControllerManager>();
    }