Update to Cubism 4 SDK for Web R5 beta5
This commit is contained in:
@ -24,7 +24,10 @@ export class CubismMoc {
|
||||
|
||||
if (moc) {
|
||||
cubismMoc = new CubismMoc(moc);
|
||||
cubismMoc._mocVersion = Live2DCubismCore.Version.csmGetMocVersion(moc);
|
||||
cubismMoc._mocVersion = Live2DCubismCore.Version.csmGetMocVersion(
|
||||
moc,
|
||||
mocBytes
|
||||
);
|
||||
}
|
||||
|
||||
return cubismMoc;
|
||||
|
@ -129,14 +129,20 @@ export class CubismUserModel {
|
||||
*/
|
||||
public loadModel(buffer: ArrayBuffer) {
|
||||
this._moc = CubismMoc.create(buffer);
|
||||
this._model = this._moc.createModel();
|
||||
this._model.saveParameters();
|
||||
|
||||
if (this._moc == null || this._model == null) {
|
||||
if (this._moc == null) {
|
||||
CubismLogError('Failed to CubismMoc.create().');
|
||||
return;
|
||||
}
|
||||
|
||||
this._model = this._moc.createModel();
|
||||
|
||||
if (this._model == null) {
|
||||
CubismLogError('Failed to CreateModel().');
|
||||
return;
|
||||
}
|
||||
|
||||
this._model.saveParameters();
|
||||
this._modelMatrix = new CubismModelMatrix(
|
||||
this._model.getCanvasWidth(),
|
||||
this._model.getCanvasHeight()
|
||||
|
Reference in New Issue
Block a user