Merge pull request #6578 from rexrainbow/mesh-setinteractive-improve

Uses current faces to do hit-testing
This commit is contained in:
Richard Davey 2023-09-07 14:08:28 +01:00 committed by GitHub
commit 540fe9ec9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1165,10 +1165,10 @@ var Mesh = new Class({
*/
setInteractive: function ()
{
var faces = this.faces;
var hitAreaCallback = function (area, x, y)
{
var faces = this.faces;
for (var i = 0; i < faces.length; i++)
{
var face = faces[i];
@ -1181,7 +1181,7 @@ var Mesh = new Class({
}
return false;
};
}.bind(this);
this.scene.sys.input.enable(this, hitAreaCallback);