private void CreateFriendCreatureIcon() { _vFriend vFriends = UserInfo.Instance.FriendInfo.vFriends; if (vFriends == null) { return; } DestroyFriendCreatureIcon(); for (int i = 0; i < vFriends.Count; ++i) { CFriend friendInfo = vFriends[i]; if (friendInfo == null) { continue; } DATA_CREATURE_NEWVER pCreatureData = CDATA_CREATURE_NEWVER.Get(friendInfo.kCreatureID); if (pCreatureData.m_iGrade < (int)m_DispatchTableData.RequireGrade) // 필요등급 검사 { continue; } DispatchTeamItemFriend friendItem = UIResourceMgr.CreatePrefab <DispatchTeamItemFriend>(BUNDLELIST.PREFABS_UI_DISPATCH, m_FriendListGrid.transform, "DispatchTeamItemFriend"); friendItem.Init(friendInfo, pCreatureData); UIEventListener.Get(friendItem.gameObject).onClick = OnClickFriendItem; _FriendList.Add(friendItem); } FriendListResetPosition(); }
private void OnClickFriendItem(GameObject go) { if (go != null) { SoundManager.Instance.PlayFX(enSoundFXUI.BUTTON_MEDIUM); } for (int i = 0; i < _FriendList.Count; ++i) { DispatchTeamItemFriend friendItem = _FriendList[i]; if (friendItem == null) { continue; } friendItem.SetActiveSelect(false); if (friendItem.gameObject == go) { if (friendItem.bDispatching == true) { // 6747 친구 지원 // 6748 친구의 크리처는 1일 1회만 사용할 수 있습니다. SystemPopupWindow.Instance.SetSystemPopup(enSystemPopupType.Ok, StringTableManager.GetData(6747), StringTableManager.GetData(6748)); if (m_SelectFriend != null) { m_SelectFriend.SetActiveSelect(true); } break; } else { friendItem.SetActiveSelect(true); m_SelectFriend = friendItem; DispatchTeamSlot slot = m_DispatchTeamSlotList[m_DispatchTeamSlotList.Count - 1]; // 친구슬롯. if (slot != null) { if (slot.CreatureIcon != null) { DestroyDispatchTeamCreature(slot); } SetTeamCount(1); CreatureIcon creatureIcon = UIResourceMgr.CreatePrefab <CreatureIcon>(BUNDLELIST.PREFABS_UI_COMMON, slot.SlotObj.transform, "CreatureIcon"); creatureIcon.SetIcon(friendItem.FriendInfo.kCreatureID, enCreatureIcon_Type.DispatchDisplayFriend); creatureIcon.CreatureKey = friendItem.FriendInfo.kFriendCharNo; creatureIcon.AddPanel(m_iPanelDepth); creatureIcon.RemoveBoxCollider(); slot.CreatureIcon = creatureIcon; slot.SetActiveSelect(false); } } } } }
//=================================================================================== // // Event // //=================================================================================== private void OnDispatchTeamSlotClose(GameObject go) { if (go != null) { SoundManager.Instance.PlayFX(enSoundFXUI.BUTTON_MEDIUM); } int iDispatchTeamSlotCount = m_DispatchTeamSlotList.Count; for (int i = 0; i < iDispatchTeamSlotCount; ++i) { DispatchTeamSlot slot = m_DispatchTeamSlotList[i]; if (slot == null) { continue; } if (slot.CloseButton == go) { DestroyDispatchTeamCreature(slot); slot.SetActiveSelect(true); if (i < iDispatchTeamSlotCount - 1) { SetSlotType(enDispatchTeamSlotType.Creature); } else { SetSlotType(enDispatchTeamSlotType.Friend); for (int k = 0; k < _FriendList.Count; ++k) // 친구슬롯이면 선택된것들 다 해제. { DispatchTeamItemFriend friendItem = _FriendList[k]; if (friendItem == null) { continue; } friendItem.SetActiveSelect(false); } } } else { slot.SetActiveSelect(false); } } }