“Eye Gaze Input”とは?
- キャラクターの視線で任意のアクションを起こすための基本的なスクリプトです。
- FPSやVRコンテンツと相性がよく、ボタンを使わずに快適なインタラクションを実現します。
- こちらからダウンロードできます。
主な特徴
- スクリプトをアタッチするだけのシンプルな実装
- サンプルボタンの容易なカスタマイズ
必要環境
- Unity4.5以上
使い方
基本編
- 凝視するオブジェクトにスクリプトを追加する MainCameraを持つオブジェクトに “Eye Gaze Input” を追加してください。
- 凝視されるオブジェクトにスクリプトを追加する 凝視されることで何らかのアクションを行いたいオブジェクトに “Eye Gaze Receiver” を追加してください。
- アクションを記述する “Eye Gaze Receiver” を追加されたオブジェクトが “Eye Gaze Input” を追加されたオブジェクトに凝視されると、凝視されたオブジェクトに OnGazeBegin メッセージが発行されます。また、視線が離れると OnGazeEnd メッセージが発行されます。 このオブジェクトに任意のスクリプトを追加し、OnGazeBegin メソッドと OnGazeEnd メソッドを記述することで任意のアクションを行います。
シンプルボタン編
- 凝視するオブジェクトにスクリプトを追加する MainCameraを持つオブジェクトに “Eye Gaze Input” を追加してください。
- ボタンを配置する /EyeGazeInput/SimpleEyeGazeButton/Prefabs/SimpleEyeGazeButton.prefabをHierarchyにドラッグ&ドロップしてください。
- アクションを記述する “Eye Gaze Receiver” を追加されたオブジェクトが “Eye Gaze Input” を追加されたオブジェクトに一定時間凝視され続けると、凝視されたオブジェクトに OnButtonGaze メッセージが発行されます。 このオブジェクトに任意のスクリプトを追加し、OnGazeButton メソッドを記述することで任意のアクションを行います。
- Inspector上では以下の設定が可能です。
- Duration OnButtonGaze を呼び出すまでの時間です。
- Normal Bg Texture 凝視されていない時のボタンの背景画像です。
- Gazing Bg Texture 凝視されている時のボタンの背景画像です。
CustomExampleDemo
- “Eye Gaze Input”を使用したデモのシーンを同梱しています。 /EyeGazeInput/CustomExampleDemo/CustomDemo.unity
動画による使い方説明
What is “Eye Gaze Input” ?
- “Eye Gaze Input” is simple script to use viewer’s gaze detection as an action trigger.
- Has a high affinity with FPS and VR content, that makes possible comfortable interaction without tapping button.
- Download from here.
Main features
- Simple Implementation; just to attatch a script.
- Easy customization of the sample scene.
Requirements
- Unity 4.5.5 or later
How to use
Basic
- Adding script to the object to set “eye gaze”. Please add the “Eye Gaze Input” to the object contains MainCamera.
- Adding script to the object to set “eye gaze”. Please add the “Eye Gaze Receiver” to the object you wish to do some action by being stare.
- Define the action When the object that has “Eye Gaze Receiver” is being stared by the object that has “Eye Gaze Receiver”, “OnGazeBegin” message will send. And if hte eye gaze left, “OnGazeEnd” message will send. You can set unique actions to adding script to the object, and using “OnGazeBegin” method and “OnGazeEnd” method.
Simple Button
- Adding script to the object to set “eye gaze”. Please add the “Eye Gaze Input” to the object contains MainCamera.
- Place the button Drag and drop “/EyeGazeInput/SimpleEyeGazeButton/Prefabs/SimpleEyeGazeButton.prefab” to Hierarchy.
- Define the action When the object that has “Eye Gaze Receiver” is being stared by the object that has “Eye Gaze Receiver”, “OnGazeBegin” message will send. And if hte eye gaze left, “OnGazeEnd” message will send. You can set unique actions to adding script to the object, and using “OnGazeBegin” method and “OnGazeEnd” method.
- Following parameters are variable at Inspector.
- Duration Time of the call to “OnButtonGaze”.
- Normal Bg Texture the button background image when it has not been staring.
- Gazing Bg Texture the button background image when it is staring.
CustomExampleDemo
- There is a demo of the scene. /EyeGazeInput/CustomExampleDemo/CustomDemo.unity
The description of the video
利用実績
Use case
- On Her Lap for SmartPhone
- For Android
- For iOS
The “Eye Gaze Input” can be purchased from the asset store in the Unity official site.