This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macroScript OpenMatEditorOnce | |
| category:"[3DGROUND]" | |
| toolTip:"OpenMatEditorOnce" | |
| buttontext:"[M]" | |
| ( | |
| on execute do | |
| ( | |
| MatEditor.Open() | |
| ) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pc.script.createLoadingScreen(function (app) { | |
| var showSplash = function () { | |
| // splash wrapper | |
| var wrapper = document.createElement('div'); | |
| wrapper.id = 'application-splash-wrapper'; | |
| document.body.appendChild(wrapper); | |
| // splash | |
| var splash = document.createElement('div'); | |
| splash.id = 'application-splash'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try (DestroyDialog rExport2Playcanvas) catch () | |
| rollout rExport2Playcanvas "Export2Playcanvas" ( | |
| fn findFile f n = ( | |
| files = getFiles (f + "*.jpg") | |
| for ff in files where (MatchPattern (filenameFromPath ff) pattern: (n + "_*.jpg")) do ( | |
| return ff | |
| ) | |
| return undefined |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var FirstPersonMovement = pc.createScript('firstPersonMovement'); | |
| FirstPersonMovement.attributes.add('camera', { | |
| type: 'entity', | |
| description: 'Optional, assign a camera entity, otherwise one is created' | |
| }); | |
| FirstPersonMovement.attributes.add('power', { | |
| type: 'number', | |
| default: 2500, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var UI = pc.createScript('ui'); | |
| var buttonSize = '30px'; | |
| var colors = [ | |
| { | |
| color: new pc.Color(255.0/255.0, 131.0/255.0, 0/255.0), | |
| hex: "#ff8300" | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SetDisk = pc.createScript('setDisk'); | |
| var currentId = 0; | |
| // initialize code called once per entity | |
| SetDisk.prototype.initialize = function() { | |
| this.app.on('setdisk', function (data) { | |
| var objs = this.app.root.findByTag(data); | |
| console.log(objs); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SetColor = pc.createScript('setColor'); | |
| SetColor.attributes.add('tag', {type: 'string', 'default': 'carpaint', title: 'Material Tag'}); | |
| // initialize code called once per entity | |
| SetColor.prototype.initialize = function() { | |
| this.app.on('setcolor', function (color) { | |
| var mats = this.app.assets.findByTag(this.tag); | |
| for (i = 0; i < mats.length; i++) { | |
| var material = mats[i].resource; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var OpenDoors = pc.createScript('openDoors'); | |
| OpenDoors.attributes.add('fromAngle', {type: 'number', default: 0, title: 'From Angle'}); | |
| OpenDoors.attributes.add('toAngle', {type: 'number', default: 70, title: 'To Angle'}); | |
| OpenDoors.attributes.add('speed', {type: 'number', default: 150.0, title: 'Speed'}); | |
| OpenDoors.attributes.add('inverted', {type: 'boolean', 'default': false}); | |
| OpenDoors.attributes.add('axis', {type: 'string', 'default': 'z'}); | |
| // initialize code called once per entity | |
| OpenDoors.prototype.initialize = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var WheelRotation = pc.createScript("wheelRotation"); | |
| WheelRotation.attributes.add("speed", { | |
| type: "number", | |
| "default": 57.2958 | |
| }); | |
| WheelRotation.attributes.add("inverted", { | |
| type: "boolean", | |
| "default": !1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Hotspot = pc.createScript('hotspot'); | |
| Hotspot.attributes.add("cameraEntity", {type: "entity", title: "Camera Entity"}); | |
| Hotspot.attributes.add("radius", {type: "number", title: "Radius"}); | |
| Hotspot.attributes.add("maxAlpha", {type: "number", title: "Alpha", default: 0.7}); | |
| Hotspot.attributes.add("fadeDropOff", { | |
| type: "number", | |
| default: 0.4, | |
| title: "Fade Drop Off", | |
| description: "When to start fading out hotspot relative to the camera direction. 1 for when hotspot is directly inline with the camera. 0 for never." |