2024-12-12 18:51:08 +08:00
using System.Collections ;
using System.Collections.Generic ;
using System.Xml.Linq ;
using UnityEngine ;
using UnityEngine.UIElements ;
public class NPCController : MonoBehaviour
{
public static NPCController instance ;
public List < RecuseNpc > npcsList = new List < RecuseNpc > ( ) ; //<2F> <> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> ɵ<EFBFBD> npc<70> Ľű<C4BD>
public GameObject npc ; //npc<70> <63> <EFBFBD> <EFBFBD> Ԥ<EFBFBD> <D4A4> <EFBFBD> <EFBFBD>
// Start is called before the first frame update
void Start ( )
{
instance = this ;
}
public void InitNPC ( Vector3 v , NpcData npcData )
{
// ʹ <> <CAB9> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> NPC<50> <43> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> trans λ<> <CEBB>
GameObject go = GameObject . Instantiate ( npc , v , Quaternion . identity ) ; // ֱ<> <D6B1> ָ<EFBFBD> <D6B8> λ<EFBFBD> ú<EFBFBD> <C3BA> <EFBFBD> ת
RecuseNpc recuseNpc = go . GetComponent < RecuseNpc > ( ) ;
recuseNpc . SetNPCInfo ( npcData . UserId ) ; //<2F> <> ʼ <EFBFBD> <CABC> npcid
2024-12-16 09:42:44 +08:00
Debug . Log ( npcData . UserId ) ;
2024-12-12 18:51:08 +08:00
npcsList . Add ( recuseNpc ) ; //<2F> <> <EFBFBD> <EFBFBD> <EFBFBD> ɵ<EFBFBD> NPC<50> Ľű<C4BD> <C5B1> <EFBFBD> <EFBFBD> <EFBFBD> list<73> <74> <EFBFBD> <EFBFBD>
}
// Update is called once per frame
void Update ( )
{
}
}