Update tutorial to use new trigger configuration for touch

This commit is contained in:
Ryan Huffman 2016-12-20 15:36:46 -08:00
parent 9ee1c64573
commit 0b2f60fb27
5 changed files with 42 additions and 14 deletions

View file

@ -74,6 +74,9 @@ TOUCH_CONTROLLER_CONFIGURATION_LEFT = {
teleport: {
defaultTextureURL: BASE_URL + "Oculus-Labels-L.fbx/Oculus-Labels-L.fbm/Teleport.png"
},
both_triggers: {
defaultTextureURL: BASE_URL + "Oculus-Labels-L.fbx/Oculus-Labels-L.fbm/Grip-Trigger.png"
},
}
},
@ -230,6 +233,9 @@ TOUCH_CONTROLLER_CONFIGURATION_RIGHT = {
teleport: {
defaultTextureURL: BASE_URL + "Oculus-Labels-R.fbx/Oculus-Labels-R.fbm/Teleport.png"
},
both_triggers: {
defaultTextureURL: BASE_URL + "Oculus-Labels-R.fbx/Oculus-Labels-R.fbm/Grip-Trigger.png"
},
}
},

View file

@ -58,6 +58,9 @@ function info() {
}
}
const CONTROLLER_TOUCH = 'touch';
const CONTROLLER_VIVE = 'vive';
var NEAR_BOX_SPAWN_NAME = "tutorial/nearGrab/box_spawn";
var FAR_BOX_SPAWN_NAME = "tutorial/farGrab/box_spawn";
var GUN_SPAWN_NAME = "tutorial/gun_spawn";
@ -323,7 +326,7 @@ function hideEntitiesWithTag(tag) {
//});
}
/**
/**
* Return the entity properties for an entity with a given name if it is in our
* cached list of entities. Otherwise, return undefined.
*/
@ -516,12 +519,14 @@ stepOrient.prototype = {
// STEP: Near Grab //
// //
///////////////////////////////////////////////////////////////////////////////
var stepNearGrab = function() {
var stepNearGrab = function(tutorialManager) {
this.name = 'nearGrab';
this.tag = "nearGrab";
this.tags = ["bothGrab", "nearGrab", "nearGrab-" + tutorialManager.controllerName];
this.tempTag = "nearGrab-temporary";
this.birdIDs = [];
this.controllerName = tutorialManager.controllerName;
Messages.subscribe("Entity-Exploded");
Messages.messageReceived.connect(this.onMessage.bind(this));
}
@ -531,11 +536,15 @@ stepNearGrab.prototype = {
this.onFinish = onFinish;
setControllerPartLayer('tips', 'trigger');
setControllerPartLayer('trigger', 'highlight');
// Spawn content set
showEntitiesWithTag(this.tag, { visible: true });
showEntitiesWithTag('bothGrab', { visible: true });
if (this.controllerName === CONTROLLER_TOUCH) {
setControllerPartLayer('both_triggers', 'highlight');
} else {
setControllerPartLayer('trigger', 'highlight');
}
// Show content set
showEntitiesWithTags(this.tags);
var boxSpawnPosition = getEntityWithName(NEAR_BOX_SPAWN_NAME).position;
function createBlock(fireworkNumber) {
@ -572,9 +581,9 @@ stepNearGrab.prototype = {
debug("NearGrab | Cleanup");
this.finished = true;
setControllerPartLayer('tips', 'blank');
setControllerPartLayer('both_triggers', 'normal');
setControllerPartLayer('trigger', 'normal');
hideEntitiesWithTag(this.tag, { visible: false});
hideEntitiesWithTag('bothGrab', { visible: false});
hideEntitiesWithTags(this.tags);
deleteEntitiesWithTag(this.tempTag);
if (this.positionWatcher) {
this.positionWatcher.destroy();
@ -696,6 +705,7 @@ PositionWatcher.prototype = {
///////////////////////////////////////////////////////////////////////////////
var stepEquip = function(tutorialManager) {
const controllerName = tutorialManager.controllerName;
this.controllerName = controllerName;
this.name = 'equip';
@ -714,8 +724,13 @@ var stepEquip = function(tutorialManager) {
}
stepEquip.prototype = {
start: function(onFinish) {
setControllerPartLayer('tips', 'trigger');
setControllerPartLayer('trigger', 'highlight');
if (this.controllerName === CONTROLLER_TOUCH) {
setControllerPartLayer('tips', 'grip');
setControllerPartLayer('grip', 'highlight');
} else {
setControllerPartLayer('tips', 'trigger');
setControllerPartLayer('trigger', 'highlight');
}
Messages.sendLocalMessage('Hifi-Grab-Disable', JSON.stringify({
holdEnabled: true,

View file

@ -52,6 +52,16 @@ TUTORIAL_TAG_TO_ENTITY_IDS_MAP = {
"tag": "farGrab"
}
},
"nearGrab-vive": {
"{88221a22-b710-4d35-852b-5257b0aa77dc}": {
"tag": "nearGrab-vive"
}
},
"nearGrab-touch": {
"{7c0f2fde-6c5c-459b-bf82-421979cebf2e}": {
"tag": "nearGrab-touch"
}
},
"nearGrab": {
"{55c861ef-60ca-4722-a6c5-9c6967966ec5}": {
"tag": "nearGrab"
@ -59,9 +69,6 @@ TUTORIAL_TAG_TO_ENTITY_IDS_MAP = {
"{644d655b-ae66-43b1-9bab-a44b9a8ad632}": {
"tag": "nearGrab"
},
"{88221a22-b710-4d35-852b-5257b0aa77dc}": {
"tag": "nearGrab"
},
"{8bf0baa1-88d0-448a-a782-100d4413bd82}": {
"tag": "nearGrab"
},