1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Unity】 Oculus Quest のバッテリー情報を取得する

Posted at

Oculus Quest でバッテリー残量を取得する方法

実装例

    float hmd = SystemInfo.batteryLevel;
    byte left = OVRInput.GetControllerBatteryPercentRemaining(OVRInput.Controller.LTouch);
    byte right = OVRInput.GetControllerBatteryPercentRemaining(OVRInput.Controller.RTouch);
    Debug.LogFormat("Battery: HMD = {0}%, Left Controller = {1}%, Right Controller = {2}%", 
        (int)(hmd * 100), left, right);

HMDのバッテリー残量

コントローラのバッテリー残量

  • OVRInput.GetControllerBatteryPercentRemaining で取得できる
    引数にコントローラ種別を渡せば、バッテリー残量がパーセンテージ数値(0~100)で返ってくる。
    ※ SystemInfo.batteryLevelのように0~1のfloat値ではないことに注意

参考

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?