From b762b28575330130382ce3ddc418462ff6866113 Mon Sep 17 00:00:00 2001 From: Robert Kowalski Date: Wed, 7 Feb 2024 21:05:31 -0500 Subject: [PATCH] Use built in HasAny to check for Mesh Game Objects --- src/input/InputPlugin.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/input/InputPlugin.js b/src/input/InputPlugin.js index 01d0db502..941d8da5e 100644 --- a/src/input/InputPlugin.js +++ b/src/input/InputPlugin.js @@ -19,6 +19,7 @@ var GetFastValue = require('../utils/object/GetFastValue'); var GEOM_CONST = require('../geom/const'); var InputPluginCache = require('./InputPluginCache'); var IsPlainObject = require('../utils/object/IsPlainObject'); +var HasAny = require('../utils/object/HasAny'); var PluginCache = require('../plugins/PluginCache'); var Rectangle = require('../geom/rectangle/Rectangle'); var RectangleContains = require('../geom/rectangle/Contains'); @@ -2163,12 +2164,8 @@ var InputPlugin = new Class({ { var config = hitArea; - var mesh = gameObjects.some(function (gameObject) - { - return gameObject.hasOwnProperty('faces'); - }); - - if (!mesh) + // Check if any supplied Game Object is a Mesh based Game Object + if (!HasAny(gameObjects, 'faces')) { hitArea = GetFastValue(config, 'hitArea', null); hitAreaCallback = GetFastValue(config, 'hitAreaCallback', null);