public void loadModelData(String path) { IPlatformManager pm = Live2DFramework.getPlatformManager(); if (debugMode) { pm.log("Load model : " + path); } live2DModel = pm.loadLive2DModel(path); live2DModel.saveParam(); if (Live2D.getError() != Live2D.L2D_NO_ERROR) { pm.log("Error : Failed to loadModelData()."); return; } var w = live2DModel.getCanvasWidth(); var h = live2DModel.getCanvasHeight(); modelMatrix = new L2DModelMatrix(w, h); if (w > h) { modelMatrix.setWidth(2); } else { modelMatrix.setHeight(2); } modelMatrix.setCenterPosition(0, 0); }
public void loadModelData(String path) { IPlatformManager pm = Live2DFramework.getPlatformManager(); if (debugMode) pm.log("Load model : " + path); live2DModel = pm.loadLive2DModel(path); live2DModel.saveParam(); if (Live2D.getError() != Live2D.L2D_NO_ERROR) { pm.log("Error : Failed to loadModelData()."); return; } var w = live2DModel.getCanvasWidth(); var h = live2DModel.getCanvasHeight(); modelMatrix = new L2DModelMatrix(w, h); if (w>h) { modelMatrix.setWidth(2); } else { modelMatrix.setHeight(2); } modelMatrix.setCenterPosition(0, 0); }
public void loadModelData(string path) { IPlatformManager manager = Live2DFramework.getPlatformManager(); if (this.debugMode) { manager.log("Load model : " + path); } this.live2DModel = manager.loadLive2DModel(path); ((Live2DModelUnity) this.live2DModel).setRenderMode(1); this.live2DModel.saveParam(); if (Live2D.getError() != 0) { manager.log("Error : Failed to loadModelData()."); } else { float w = this.live2DModel.getCanvasWidth(); float h = this.live2DModel.getCanvasHeight(); this.modelMatrix = new L2DModelMatrix(w, h); if (w > h) { this.modelMatrix.setWidth(2f); } else { this.modelMatrix.setHeight(2f); } this.modelMatrix.setCenterPosition(0f, 0f); } }