Coder Social home page Coder Social logo

satoshirobatofujimoto / motioncontrollermanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from takahiromiyaura/motioncontrollermanager

0.0 1.0 0.0 7.48 MB

WinMRでモーションコントローラの操作に対してイベント制御を可能にする部品です。

License: MIT License

C# 96.05% ShaderLab 3.01% HLSL 0.94%

motioncontrollermanager's Introduction

MotionControllerManager-

WinMRでモーションコントローラの操作に対してイベント制御を可能にする部品です。

環境

以下の環境で作成しています。

主な機能

MotionControllerの各ボタンに対して押す/離す/保持の状態でイベントを管理することができるMotionContollerManagerクラスを提供します。

イベント名 説明
Grasped Occurs when grasp button of motion controller is pressed.
Released Occurs when grasp button of motion controller is released.
MenuDown Occurs when a menu button of motion controller is pressed.
MenuUp Occurs when a menu button of motion controller is released.
MotionControllerManipulate Occurs when motion controller is manipulated.
SelectDown Occurs when select button of motion controller is pressed.
SelectHold Occurs when select button of motion controller is held.
SelectUp Occurs when select button of motion controller is released.
ThumbstickDown Occurs when thumbstick button of motion controller is pressed.
ThumbstickHold Occurs when thumbstick button of motion controller is held.
ThumbstickUp Occurs when thumbstick button of motion controller is released.
TouchpadTouch Occurs when touchpad button of motion controller is touched.
TouchpadDown Occurs when touchpad button of motion controller is pressed.
TouchpadHold Occurs when touchpad button of motion controller is held.
TouchpadUp Occurs when touchpad button of motion controller is released.

各ボタンの押下時にモーションコントローラのポインターに向けてマーカーを出力します。

sampleImage

実装方法

  1. MotionControllerManager.prefabをHierarchyにセットします。
  2. 任意のスクリプト内でMotionControllerManagerに対してイベントを定義します。
void Start () 
{
    MotionControllerManager.Instance.TouchpadTouch += TouchpadTouch;
    MotionControllerManager.Instance.Grasped += GraspedPress;
    MotionControllerManager.Instance.Released+= GraspedRelease;
    MotionControllerManager.Instance.MenuDown+= MenuPress;
    MotionControllerManager.Instance.MenuUp+= MenuRelease;
    MotionControllerManager.Instance.SelectHold+= SelectManupilate;
    MotionControllerManager.Instance.SelectDown+= SelectPress;
    MotionControllerManager.Instance.SelectUp+= SelectRelease;
    MotionControllerManager.Instance.ThumbstickHold+= ThumbstickManupilate;
    MotionControllerManager.Instance.ThumbstickDown+= ThumbstickPress;
    MotionControllerManager.Instance.ThumbstickUp+= ThumbstickRelease;
    MotionControllerManager.Instance.TouchpadHold+= TouchpadManupilate;
    MotionControllerManager.Instance.TouchpadUp+= TouchpadRelease;
    MotionControllerManager.Instance.TouchpadDown+= TouchpadPress;
}
  1. マーカー出力の有無はMotionControllerManagerのInspector内で変更します。

motioncontrollermanager's People

Contributors

takahiromiyaura avatar

Watchers

Satoshi Gachi Fujimoto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.