|
|
|
@ -267,30 +267,30 @@ namespace Unity.BossRoom.Gameplay.UI
|
|
|
|
|
// make sure allies array is ready
|
|
|
|
|
// InitPartyArrays();
|
|
|
|
|
|
|
|
|
|
int openslot = -1;
|
|
|
|
|
for (int i = 0; i < m_PartyIds.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
// if this ID is in the list, return the slot index
|
|
|
|
|
if (m_PartyIds[i] == id) { return i; }
|
|
|
|
|
// otherwise, record the first open slot (not slot 0 thats for the Hero)
|
|
|
|
|
if (openslot == -1 && i > 0 && m_PartyIds[i] == 0)
|
|
|
|
|
{
|
|
|
|
|
openslot = i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if we don't add, we are done nw and didnt fint the ID
|
|
|
|
|
if (dontAdd) { return -1; }
|
|
|
|
|
|
|
|
|
|
// Party slot was not found for this ID - add one in the open slot
|
|
|
|
|
if (openslot > 0)
|
|
|
|
|
{
|
|
|
|
|
// activeate the correct ally panel
|
|
|
|
|
m_AllyPanel[openslot - 1].SetActive(true);
|
|
|
|
|
// and save ally ID to party array
|
|
|
|
|
m_PartyIds[openslot] = id;
|
|
|
|
|
return openslot;
|
|
|
|
|
}
|
|
|
|
|
// int openslot = -1;
|
|
|
|
|
// for (int i = 0; i < m_PartyIds.Length; i++)
|
|
|
|
|
// {
|
|
|
|
|
// // if this ID is in the list, return the slot index
|
|
|
|
|
// if (m_PartyIds[i] == id) { return i; }
|
|
|
|
|
// // otherwise, record the first open slot (not slot 0 thats for the Hero)
|
|
|
|
|
// if (openslot == -1 && i > 0 && m_PartyIds[i] == 0)
|
|
|
|
|
// {
|
|
|
|
|
// openslot = i;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // if we don't add, we are done nw and didnt fint the ID
|
|
|
|
|
// if (dontAdd) { return -1; }
|
|
|
|
|
//
|
|
|
|
|
// // Party slot was not found for this ID - add one in the open slot
|
|
|
|
|
// if (openslot > 0)
|
|
|
|
|
// {
|
|
|
|
|
// // activeate the correct ally panel
|
|
|
|
|
// m_AllyPanel[openslot - 1].SetActive(true);
|
|
|
|
|
// // and save ally ID to party array
|
|
|
|
|
// m_PartyIds[openslot] = id;
|
|
|
|
|
// return openslot;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// this should not happen unless there are too many players - we didn't find the ally or a slot
|
|
|
|
|
return -1;
|
|
|
|
|