fix(stage-ui-live2d): avoid proxying renderer instances (#2386)
This commit is contained in:
@@ -3,7 +3,7 @@ import { Application } from '@pixi/app'
|
||||
import { extensions } from '@pixi/extensions'
|
||||
import { Ticker, TickerPlugin } from '@pixi/ticker'
|
||||
import { Live2DModel } from 'pixi-live2d-display/cubism4'
|
||||
import { onMounted, onUnmounted, ref, watch } from 'vue'
|
||||
import { onMounted, onUnmounted, ref, shallowRef, watch } from 'vue'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
width: number
|
||||
@@ -23,7 +23,7 @@ const componentState = defineModel<'pending' | 'loading' | 'mounted'>('state', {
|
||||
|
||||
const containerRef = ref<HTMLDivElement>()
|
||||
const isPixiCanvasReady = ref(false)
|
||||
const pixiApp = ref<Application>()
|
||||
const pixiApp = shallowRef<Application>()
|
||||
const pixiAppCanvas = ref<HTMLCanvasElement>()
|
||||
|
||||
function resolveMaxFps(limit?: number) {
|
||||
|
||||
@@ -93,7 +93,7 @@ const offset = computed(() => ({
|
||||
const pixiApp = toRef(() => props.app)
|
||||
const paused = toRef(() => props.paused)
|
||||
const focusAt = toRef(() => props.focusAt)
|
||||
const model = ref<Live2DModel<PixiLive2DInternalModel>>()
|
||||
const model = shallowRef<Live2DModel<PixiLive2DInternalModel>>()
|
||||
const initialModelWidth = ref<number>(0)
|
||||
const initialModelHeight = ref<number>(0)
|
||||
const mouthOpenSize = computed(() => Math.max(0, Math.min(100, props.mouthOpenSize)))
|
||||
@@ -176,7 +176,7 @@ const live2dExpressionEnabled = toRef(() => props.live2dExpressionEnabled)
|
||||
const live2dShadowEnabled = toRef(() => props.live2dShadowEnabled)
|
||||
|
||||
// --- Expression controller
|
||||
const internalModelRef = ref<PixiLive2DInternalModel>()
|
||||
const internalModelRef = shallowRef<PixiLive2DInternalModel>()
|
||||
const expressionController = useExpressionController({
|
||||
internalModel: internalModelRef,
|
||||
modelId: props.modelId,
|
||||
|
||||
Reference in New Issue
Block a user