我正在尝试使用 JS 中的脚本更改动画序列的当前帧,但我找不到Scene.root.find....
资产的等价物……我正在尝试创建一个“你是谁?” 我将滚动代码制作为图像,但我不知道如何使用脚本访问它?
1 回答
1
如果我做对了,这将对您有所帮助。
const Materials = require('Materials');
const mat = Materials.get('matName');
// set your number here, or an animation
mat.diffuse.currentFrame = 1;
UPD 2021 年 5 月 8 日:现在您应该使用异步方法:
const M = require("Materials");
const D = require("Diagnostics");
(async function () {
const mat = await M.findFirst("material0");
const diff = await mat.getDiffuse();
diff.currentFrame = 1;
})();
于 2020-02-04T14:54:56.197 回答