fix(pets): cat renders on shared KiraAvatar canvas via onAppReady callback
Single WebGL context, no bindBuffer spam. Cat model loads onto KiraAvatar's stage and positions itself at bottom-right corner. PetZone passes app prop through to Live2DCat.
This commit is contained in:
@@ -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,7 @@ export default function KiraAvatar(props: Props) {
|
||||
app.stage.addChild(model as any);
|
||||
(model as any).isInteractive = () => false;
|
||||
if (!mounted) return;
|
||||
if (props.onAppReady) props.onAppReady(app);
|
||||
|
||||
try {
|
||||
textureRef.current = {
|
||||
|
||||
Reference in New Issue
Block a user