mirror of
https://github.com/ayangweb/BongoCat.git
synced 2026-03-12 17:51:48 +08:00
refactor: optimize the parameter setting logic using type assertions (#169)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { Cubism4InternalModel } from 'pixi-live2d-display'
|
||||
|
||||
import { Live2DModel } from 'pixi-live2d-display'
|
||||
import { Application, Ticker } from 'pixi.js'
|
||||
|
||||
@@ -57,7 +59,9 @@ class Live2d {
|
||||
}
|
||||
|
||||
public setParameterValue(id: string, value: number | boolean) {
|
||||
return this.model?.internalModel.coreModel.setParameterValueById(id, Number(value))
|
||||
const internalModel = this.model?.internalModel as Cubism4InternalModel
|
||||
|
||||
return internalModel.coreModel.setParameterValueById(id, Number(value))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user