[Unity with Typescript] 제페토 로컬 캐릭터에 AddComponent 하기

Kim Yuhyeon·2023년 2월 11일
0

참고

https://github.com/naverz/zepeto-studio-kor/discussions/176

    Start() {
        // Grab the user id specified from logging into zepeto through the editor. 
        ZepetoPlayers.instance.CreatePlayerWithUserId(WorldService.userId, new SpawnInfo(), true);
        ZepetoPlayers.instance.OnAddedLocalPlayer.AddListener(() => {
            let _player = ZepetoPlayers.instance.LocalPlayer.zepetoPlayer;
            _player.character.gameObject.AddComponent<T>();
        });
        
    }

0개의 댓글