diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json b/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json index ec26cf66ac..6774e87b9b 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json @@ -60,6 +60,35 @@ "shapeType": "compound", "type": "Model", "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, + { + "color": { + "blue": 255, + "green": 0, + "red": 255 + }, + "name": "home_sphere_cellsciencePortkey", + "href": "hifi://cellscience", + "script": "atp:/switches/portkey.js", + "visible": false, + "dimensions": { + "x": 0.111, + "y": 0.111, + "z": 0.111 + }, + "position": { + "x": 0.0, + "y": -0.2, + "z": 0.0 + }, + "queryAACube": { + "scale": 0.25831151008605957, + "x": -0.12915575504302979, + "y": -0.12915575504302979, + "z": -0.10074388980865479 + }, + "type": "Sphere", + "userData": "{\"hifiHomeKey\":{\"reset\":true}, \"grabbableKey\": {\"wantsTrigger\": true}}" }], "Version": 57 } \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/switches/portkey.js b/unpublishedScripts/DomainContent/Home/switches/portkey.js new file mode 100644 index 0000000000..e6065e24ea --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/switches/portkey.js @@ -0,0 +1,42 @@ +// +// portkey.js +// +// +// Created by Eric Levin on 3/28/2016 +// Copyright 2016 High Fidelity, Inc. +// +// This entity script is designed to teleport a user to an in-world location specified in object's userdata +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +(function() { + + Script.include("atp:/utils.js"); + var _this = this; + + + this.startFarTrigger = function() { + _this.teleport(); + } + + this.startNearTrigger = function() { + _this.teleport(); + } + + this.startNearGrab = function() { + _this.teleport(); + } + + this.teleport = function() { + Window.location = _this.portkeyLink; + } + + this.preload = function(entityID) { + _this.entityID = entityID; + _this.portkeyLink = Entities.getEntityProperties(_this.entityID, "href").href; + } + +}); \ No newline at end of file