Spark AR - 无法使用 Scene.create() 方法创建场景对象

Spark AR - Can't create an Scene Object with Scene.create() method

我的代码在下面,我在控制台中收到警告 Possible unhandled promise rejection: Typeerror: undefined is not a function

错误跟踪将始终指向 Scene.create() 方法,即使根据文档,这是一个有效的调用

https://sparkar.facebook.com/ar-studio/learn/reference/classes/scenemodule#methods

const Scene = require('Scene');
const D = require('Diagnostics');

(async function () {
  const sprites = [];

  for (const i = 0; i < 3; i++) {
    const dynamicSprite = await Scene.create("PlanarImage", {
        "name": `sprite${i}`,
        "width": 0.1,
        "height": 0.1,
        "x": 0,
        "y": 0,
        "hidden": true,
        'material' : 'material1'
    });

    sprites.push(dynamicSprite );
  }
})();

我检查的内容:

用这个答案解决了

必须在项目中启用动态实例化。