// 宠物加载回调aa protected void OnLoadPet(ResLoadParams kParam, UnityEngine.Object kObj) { if (kObj == null) { return; } if (m_pvpRival == null) { return; } Hashtable kPetProperty = mActivePet; if (kPetProperty == null) { return; } Vector3 kPlayerPos = m_pvpRival.transform.position; Vector3 kBornPosition = kPlayerPos; float fFollowDistance = ((int)(kPetProperty["FollowDistance"])) / 1000.0f; sdTuiTuLogic.BornPosition(kPlayerPos, fFollowDistance, ref kBornPosition); GameObject kPetObj = GameObject.Instantiate(kObj, kBornPosition, Quaternion.identity) as GameObject; sdGameMonster kActivePet = kPetObj.GetComponent <sdGameMonster>(); if (kActivePet != null) { kActivePet.templateId = (int)kPetProperty["TemplateID"]; kActivePet.bornLive = true; kActivePet.DBID = (ulong)kPetProperty["DBID"]; kActivePet.Master = m_pvpRival; m_pvpRival.Retainer = kActivePet; kActivePet.NotifyKilled += OnPetKilled; kActivePet.ChangeGroupID(GroupIDType.GIT_MonsterA); // 宠物战队Buffaa List <int> kBuffList = GetPetGroupBuff(kActivePet); if (kBuffList != null) { foreach (int iBuffId in kBuffList) { kActivePet.AddBuff(iBuffId, 0, kActivePet); } } } }