fix(webgl): share single Pixi context between KiraAvatar and Live2DCat

Eliminates WebGL bindBuffer/bindTexture spam from dual Application contexts.
Cat model now loads onto KiraAvatar's shared stage via onAppReady callback.
This commit is contained in:
2026-06-05 13:04:43 -04:00
parent 017c81cffa
commit be1e51cc9a
4 changed files with 33 additions and 51 deletions
+3
View File
@@ -7,6 +7,7 @@ interface Props {
outfit: string;
accessory: string | null;
onTalkToggle: () => void;
onAppReady?: (app: any) => void;
}
type ExpressionName = 'Normal' | 'Smile' | 'Sad' | 'Angry' | 'Surprised' | 'Blushing';
@@ -82,6 +83,8 @@ export default function KiraAvatar(props: Props) {
app.stage.addChild(model as any);
(model as any).isInteractive = () => false;
if (props.onAppReady) props.onAppReady(app);
try {
textureRef.current = {
index: 2,