yotiky Tech Blog

とあるエンジニアの備忘録

MRTK v2 - Button (Prefabs)

目次

TL;DR

Mixed Reality Toolkit Documentation の UX Building Blocks の章の Button から要点と補足をまとめたページです。

検証環境

  • Unity:2019.2.7f2
  • MRTK:2.3.0 / 2.4.0
  • VisualStudio:2019
  • Device:HoloLens2

内容

ドキュメントは2.4をベースに書かれている。
詳細はこちら。 microsoft.github.io

非公式日本語はこちら。 hololabinc.github.io

Button prefabs in MRTK

2D(UnityUI)向け

  • UnityUIInteractableButton
  • PressableButtonUnityUI
  • PressableButtonUnityUICircular
  • PressableButtonHoloLens2UnityUI

3D

2.4

ToolBoxから参照したり追加したりできるのでそちらを使う。

Buttons f:id:yotiky:20200603202640p:plain

Button Collections f:id:yotiky:20200603202708p:plain

Microsoft.MixedReality.Toolkit.Unity.Examples パッケージに以下のボタンが梱包されている。 画像はリスト順に左からの順になっている。

  • ExampleHubButton
  • Model_PushButton
  • PressableButtonHoloLens2_AppButton
  • PressableRoundButton
  • RecordButton

なお、PressableRoundButtonはパッケージをインポートするとToolBoxにも追加される。

2.3

2.3はToolBoxがないので2.4の画面キャプチャを参考にすると良い。
なお、以下のボタンは2.4から追加されたので2.3には含まれない。

  • PressableButtonHoloLens2Toggle_32x96
  • PressableButtonHoloLens2Toggle_40x40
  • PressableButtonHoloLens2Toggle_48x48
  • PressableButtonHoloLens2ToggleCheckBox_32x32
  • PressableButtonHoloLens2ToggleCheckBox_32x96
  • PressableButtonHoloLens2ToggleRadio_32x32
  • PressableButtonHoloLens2ToggleRadio_32x96
  • PressableButtonHoloLens2ToggleSwitch_32x32
  • PressableButtonHoloLens2ToggleSwitch_32x96
  • SlateUGUIHoloLens2Buttons

f:id:yotiky:20200603211013p:plain:w300

Microsoft.MixedReality.Toolkit.Unity.Examples パッケージに以下のボタンが梱包されている。 画像はリスト順に右からの順になっている。

  • ExampleHubButton
  • Model_PushButton
  • PressableRoundButton
  • RecordButton