0
如何将此语言环境变量放入主脚本中。我怎样才能从它做一个全局变量?此变体不起作用,感谢您的帮助。如何将此语言环境变量放入主脚本。
//Test Script local to global
(function (exampleCode) {
\t "use strict";
\t
var wert = 0.5;
var name = 'wert';
Object.assign(exampleCode, {
\t getValue: function() {
\t return name;
\t }
\t });
\t
})(window.exampleCode = window.exampleCode || {});
/////////////////////////////////////////////////////////////////////
//main script get 'var wert = 0.5' from Test Script
var update = function() {
\t \t requestAnimationFrame(update); \t \t \t \t \t \t
\t \t \t //var value = wert; //0.5
\t \t \t console.log(exampleCode.getValue());
\t \t \t mesh.morphTargetInfluences[ 40 ] = params.influence1 = value; \t \t
\t \t }; \t
\t \t \t
\t \t update(); \t \t
是,此后正是我寻觅了,谢谢您 – Tom