r3-custom-code/cgw7pwx0jg.js

65 lines
912 B
JavaScript

if (R3.Utils.UndefinedOrNull(this.entityLoaded)) {
return;
}
var touch = data;
var max = Math.max(touch.left, touch.right, touch.up, touch.down);
var units = Math.floor(max / 150) + 1;
if (typeof max === 'number') {
if (max < 5) {
R3.Event.Emit(
R3.Event.KEY_DOWN,
{
code : 'ArrowUp'
}
);
} else {
if (max === touch.left) {
for (var i = 0; i < units; i++) {
R3.Event.Emit(
R3.Event.KEY_DOWN,
{
code : 'ArrowLeft'
}
);
}
}
if (max === touch.right) {
for (var i = 0; i < units; i++) {
R3.Event.Emit(
R3.Event.KEY_DOWN,
{
code : 'ArrowRight'
}
);
}
}
if (max === touch.up) {
R3.Event.Emit(
R3.Event.KEY_DOWN,
{
code : 'ArrowUp'
}
);
}
if (max === touch.down) {
R3.Event.Emit(
R3.Event.KEY_DOWN,
{
code : 'Space'
}
);
}
}
}
//# sourceURL=touchEnd.js