Comparing version 1.0.0 to 1.0.1
@@ -24,6 +24,6 @@ /** | ||
let loader = new RegExp("Build/QB3DEngine.loader.js"); | ||
let framework = new RegExp("Build/QB3DEngine.framework.js"); | ||
let data = new RegExp("Build/QB3DEngine.data"); | ||
let wasm = new RegExp("Build/QB3DEngine.wasm"); | ||
let loader = new RegExp("Build/AB3DEngine.loader.js"); | ||
let framework = new RegExp("Build/AB3DEngine.framework.js"); | ||
let data = new RegExp("Build/AB3DEngine.data"); | ||
let wasm = new RegExp("Build/AB3DEngine.wasm"); | ||
@@ -33,12 +33,12 @@ for (let i = 0; i < res.length; i++) { | ||
if (loader.test(src[1])) { | ||
content = content.replace(src[1], 'https://bime.oss-cn-chengdu.aliyuncs.com/EngineLibrary/QB3DEngine.data/QB3DEngine.loader.js'); | ||
content = content.replace(src[1], 'http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.loader.js'); | ||
} | ||
if (framework.test(src[1])) { | ||
content = content.replace(src[1], 'https://bime.oss-cn-chengdu.aliyuncs.com/EngineLibrary/QB3DEngine.data/QB3DEngine.framework.js'); | ||
content = content.replace(src[1], 'http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.framework.js'); | ||
} | ||
if (data.test(src[1])) { | ||
content = content.replace(src[1], 'https://bime.oss-cn-chengdu.aliyuncs.com/EngineLibrary/QB3DEngine.data/QB3DEngine.data'); | ||
content = content.replace(src[1], 'http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.data'); | ||
} | ||
if (wasm.test(src[1])) { | ||
content = content.replace(src[1], 'https://bime.oss-cn-chengdu.aliyuncs.com/EngineLibrary/QB3DEngine.data/QB3DEngine.wasm'); | ||
content = content.replace(src[1], 'http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.wasm'); | ||
} | ||
@@ -96,3 +96,3 @@ } | ||
var pa = fs.readdirSync(filepath); | ||
if (filepath.indexOf("sample") != -1||filepath.indexOf("Build")!=-1||filepath.indexOf("doc")!=-1) | ||
if (filepath.indexOf("sample") != -1 || filepath.indexOf("Build") != -1 || filepath.indexOf("doc") != -1||filepath.indexOf("Test") != -1) | ||
return result; | ||
@@ -99,0 +99,0 @@ console.log(pa); |
103
JS/ab3d.js
import Interface from "./Interface.js"; | ||
import Event from "./System/Event.js"; | ||
// import IndexDBCache from "./System/IndexDBCache.js"; | ||
import IndexDBCache from "./System/IndexDBCache.js"; | ||
@@ -33,7 +33,7 @@ var AB3D = window.AB3D = AB3D || {}; | ||
}); | ||
function localDebugging() { | ||
db.cacheFile("Build/AB3DEngine.data").then((data) => { | ||
db.cacheFile("Build/AB3DEngine.wasm").then((wasm) => { | ||
script.setAttribute('src', 'Build/AB3DEngine.loader.js'); | ||
release | ||
function release() { | ||
db.cacheFile(param.host +"AB3DEngine.data").then((data) => { | ||
db.cacheFile(param.host +"AB3DEngine.wasm").then((wasm) => { | ||
script.setAttribute('src', param.host +'AB3DEngine.loader.js'); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
@@ -43,3 +43,3 @@ script.onload = () => { | ||
dataUrl: data, | ||
frameworkUrl: "Build/AB3DEngine.framework.js", | ||
frameworkUrl: param.host +"AB3DEngine.framework.js", | ||
codeUrl: wasm, | ||
@@ -85,2 +85,91 @@ streamingAssetsUrl: "StreamingAssets", | ||
} | ||
function npm version patch() { | ||
script.setAttribute('src', 'http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.loader.js'); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
script.onload = () => { | ||
createUnityInstance(canvas, { | ||
dataUrl: "http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.data", | ||
frameworkUrl: "http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.framework.js", | ||
codeUrl: "http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.wasm", | ||
streamingAssetsUrl: "StreamingAssets", | ||
companyName: "DefaultCompany", | ||
productName: "EnvironmentEditor", | ||
productVersion: "0.1", | ||
// matchWebGLToCanvasSize: false, //取消注释以分别控制WebGL画布的渲染大小和DOM元素的大小。 | ||
// devicePixelRatio: 1, // 取消注释将覆盖在高DPI显示上的低DPI渲染。 | ||
}).then((unityInstance) => { | ||
unityInstance.parentNode = parentNode; | ||
QB3D.interface = new Interface(unityInstance, db, param.succeed); | ||
unityInstance.Invoke = function (prama, register) { | ||
if (register) { | ||
for (const re of register) { | ||
Event.addEvent(re.code, re.callBack); | ||
} | ||
} | ||
unityInstance.SendMessage("Interface", "Reflect", JSON.stringify(prama)); | ||
} | ||
unityInstance.Untie = function (register) { | ||
for (const re of register) { | ||
Event.removeEvent(re.code, re.callBack); | ||
} | ||
} | ||
unityInstance.Register = function (register) { | ||
if (register) { | ||
for (const re of register) { | ||
Event.addEvent(re.code, re.callBack); | ||
} | ||
} | ||
} | ||
}).catch((message) => { | ||
alert(message); | ||
}); | ||
} | ||
} | ||
function localDebugging() { | ||
db.cacheFile(param.host + "http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.data").then((data) => { | ||
db.cacheFile(param.host + "http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.wasm").then((wasm) => { | ||
script.setAttribute('src', param.host + 'http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.loader.js'); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
script.onload = () => { | ||
createUnityInstance(canvas, { | ||
dataUrl: data, | ||
frameworkUrl: param.host + "http://192.168.1.111/unity/resource//usr/share/nginx/html/unity/resource/AB3DEngine.framework.js", | ||
codeUrl: wasm, | ||
streamingAssetsUrl: "StreamingAssets", | ||
companyName: "DefaultCompany", | ||
productName: "EnvironmentEditor", | ||
productVersion: "0.1", | ||
// matchWebGLToCanvasSize: false, //取消注释以分别控制WebGL画布的渲染大小和DOM元素的大小。 | ||
// devicePixelRatio: 1, // 取消注释将覆盖在高DPI显示上的低DPI渲染。 | ||
}).then((unityInstance) => { | ||
unityInstance.parentNode = parentNode; | ||
var db = new IndexDBCache(); | ||
QB3D.interface = new Interface(unityInstance, db, param.succeed); | ||
unityInstance.Invoke = function (prama, register) { | ||
if (register) { | ||
for (const re of register) { | ||
Event.addEvent(re.code, re.callBack); | ||
} | ||
} | ||
unityInstance.SendMessage("Interface", "Reflect", JSON.stringify(prama)); | ||
} | ||
unityInstance.Untie = function (register) { | ||
for (const re of register) { | ||
Event.removeEvent(re.code, re.callBack); | ||
} | ||
} | ||
unityInstance.Register = function (register) { | ||
if (register) { | ||
for (const re of register) { | ||
Event.addEvent(re.code, re.callBack); | ||
} | ||
} | ||
} | ||
}).catch((message) => { | ||
alert(message); | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
@@ -87,0 +176,0 @@ export { |
{ | ||
"name": "abengine", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "引入 npm i ABengine", | ||
@@ -5,0 +5,0 @@ "main": "ab3d.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Known malware
Supply chain riskThis package is malware. We have asked the package registry to remove it.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26550
697
1
3