Comment faire pour obtenir cette variable locale dans le script principal. Comment puis-je en faire une variable globale? Cette variante ne fonctionne pas, merci pour l'aide.Comment obtenir cette variable locale dans le script principal.
//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
Oui, exactement après, je l'ai recherché, merci toi – Tom