private void setupMode() { switch (currentMode) { case MagicMode.TheForce: switchToForceMode(); previousMode = currentMode; break; case MagicMode.MagicBall: switchToMagicBallMode(); previousMode = currentMode; break; case MagicMode.MagicBow: switchToMagicBowMode(); previousMode = currentMode; break; case MagicMode.BigMagic: switchToBigMagicMode(); previousMode = currentMode; break; } }
// Update is called once per frame void Update() { var device = SteamVR_Controller.Input((int)rightControllerTrackedObj.index); if (device.GetPressDown(SteamVR_Controller.ButtonMask.Touchpad)) { if (device.GetAxis().x > 0 && device.GetAxis().y > 0) { currentMode = MagicMode.TheForce; } if (device.GetAxis().x < 0 && device.GetAxis().y > 0) { currentMode = MagicMode.MagicBall; } if (device.GetAxis().x < 0 && device.GetAxis().y < 0) { currentMode = MagicMode.MagicBow; } if (device.GetAxis().x > 0 && device.GetAxis().y < 0) { currentMode = MagicMode.BigMagic; } } if (currentMode != previousMode) { setupMode(); } }
public void SetProperties(MagicMode mode, object properties) { switch (mode) { case MagicMode.File: this.SetFile((FileProperties)properties); break; case MagicMode.JPG: this.SetJPG((JPGExif)properties); break; case MagicMode.MP3: this.SetMP3((MP3Tag)properties); break; default: this.SetNone(); break; } }
// Use this for initialization void Start() { currentMode = MagicMode.TheForce; setupMode(); }