Commit e301b761 authored by 任建锋's avatar 任建锋

--

parents e0d639cc fdb8d464
...@@ -4,16 +4,20 @@ ...@@ -4,16 +4,20 @@
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"dts-bundle": "^0.7.3",
"glob": "^7.1.6",
"rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5. 2.0", "rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-progress": "^1.1.1", "rollup-plugin-progress": "^1.1.1",
"rollup-plugin-typescript": "^1.0.1", "rollup-plugin-typescript": "^1.0.1",
"rollup-plugin-uglify": "^6.0.4" "rollup-plugin-typescript2": "^0.25.2",
"rollup-plugin-uglify": "^6.0.3",
"typescript": "^2.7.2"
}, },
"dependencies": { "dependencies": {
"protobufjs": "^6.8.8", "protobufjs": "^6.8.8",
"tslib": "^1.10.0", "tslib": "^1.10.0",
"typescript": "^3.7.3" "typescript": "^2.7.2"
}, },
"scripts": { "scripts": {
"dev": "rollup -c -m -w", "dev": "rollup -c -m -w",
......
...@@ -26,17 +26,22 @@ export class Svga extends MovieClip { ...@@ -26,17 +26,22 @@ export class Svga extends MovieClip {
private _setSource(value) { private _setSource(value) {
if (value !== this._source) { if (value !== this._source) {
this._source = value; this._source = value;
let needLoad = true; let needLoad = true;
if (value.indexOf('://') >= 0) { //如果是有协议的地址 if (value.indexOf('://') >= 0) { //如果是有协议的地址
if (value.indexOf(assetScheme) === 0) { if (value.indexOf(assetScheme) === 0) {
let uuid = value.replace(assetScheme, ''); let uuid = value.replace(assetScheme, '');
let mv = engine.globalLoader.get(uuid); let mv = engine.globalLoader.get(uuid);
engine.globalLoader['loadSvga'](engine["assetResolver"](uuid))
.then(mv => {
this.children.length=0
this.init(mv); this.init(mv);
this._dataInitialized(); this._dataInitialized();
this.mouseChildren=false;
});
needLoad = false; needLoad = false;
} }
} }
if(needLoad){ if(needLoad){
engine.globalLoader['loadSvga'](value) engine.globalLoader['loadSvga'](value)
.then(mv => { .then(mv => {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment