Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit 22f3ee3

Browse files
committed
can get live2DMgr
1 parent f427932 commit 22f3ee3

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/cLive2DApp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function theRealInit (){
8484
changeModel(config.model.jsonPath);
8585
startDraw();
8686

87-
87+
return live2DMgr;
8888
}
8989

9090
/**

src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ import { EventEmitter } from './utils/EventEmitter';
1818
if (process.env.NODE_ENV === 'development'){
1919
console.log('--- --- --- --- ---\nLive2Dwidget: Hey that, notice that you are now in DEV MODE.\n--- --- --- --- ---');
2020
}
21-
22-
let coreApp;
2321
/**
2422
* The main entry point, which is ... nothing
2523
*/
@@ -60,8 +58,8 @@ class L2Dwidget extends EventEmitter {
6058
return;
6159
}
6260
import(/* webpackMode: 'lazy' */ './cLive2DApp').then(f => {
63-
coreApp = f;
64-
coreApp.theRealInit(this);
61+
this.coreApp = f;
62+
this.live2DMgr = this.coreApp.theRealInit(this);
6563
}).catch(err => {
6664
console.error(err);
6765
});
@@ -75,7 +73,7 @@ class L2Dwidget extends EventEmitter {
7573
*/
7674

7775
captureFrame(callback){
78-
return coreApp.captureFrame(callback);
76+
return this.coreApp.captureFrame(callback);
7977
}
8078

8179
/**

0 commit comments

Comments
 (0)