Search Unity

GVR SDK for Unity v1.130.1

Discussion in 'Daydream' started by piza009, May 25, 2018.

  1. piza009

    piza009

    Joined:
    May 25, 2018
    Posts:
    1
    I am developing applications with MirageSolo using Unity 2017.4.2 f 2.
    SDK uses GoogleVRForUnity_1.130.1.
    I'd like to acquire the height of the floor now but it will not work.
    As an execution result, bool: True float: -1.6 is returned.
    Is this my problem? Or is it a problem with SDK?
    Please tell me.

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Test : MonoBehaviour {
    6.  
    7.     public TextMesh text;
    8.     float height;
    9.  
    10.     // Use this for initialization
    11.     void Start () {
    12.        
    13.     }
    14.  
    15.     // Update is called once per frame
    16.     void Update () {
    17.  
    18.         bool test = GvrHeadset.TryGetFloorHeight(ref height);
    19.         text.text = "bool:" + test + "float:" + height;
    20.  
    21.  
    22.     }
    23. }
    24.  

    ____________________
    TryGetFloorHeight


    bool TryGetFloorHeight(
    ref float floorHeight
    )

    If a floor is found, populates floorHeight with the detected height.

    Otherwise, leaves the value unchanged. Returns true if value retrieval was successful, false otherwise (depends on tracking state).
    _____________________