"다이아 앨범은 순차적으로 열리는데, 하트도 순차적으로 열리다보니 다이아로 미리 앨범을 열거나 한 경우, 하트 앨범이 너무 정체되는 현상이 발생됩니다.
다이아 앨범이 열려있는 경우, 하트 앨범을 순서에 상관 없이 열 수 있도록 수정 가능한가요?"
This commit is contained in:
parent
b83eb4a430
commit
5bd7d63886
|
|
@ -33,6 +33,7 @@ namespace ES3Types
|
|||
writer.WriteProperty("InterstitialADCount", instance.InterstitialADCount, ES3Type_int.Instance);
|
||||
writer.WriteProperty("ImageOpenStates_Left", instance.ImageOpenStates_Left, ES3Type_boolArray.Instance);
|
||||
writer.WriteProperty("ImageOpenStates_Right", instance.ImageOpenStates_Right, ES3Type_boolArray.Instance);
|
||||
writer.WriteProperty("HeartImageOpen", instance.HeartImageOpen, ES3Type_boolArray.Instance);
|
||||
writer.WriteProperty("UnlockProgress", instance.UnlockProgress, ES3Type_longArray.Instance);
|
||||
writer.WriteProperty("NormalGameLevel", instance.NormalGameLevel, ES3Type_int.Instance);
|
||||
writer.WriteProperty("NormalGame_GetGold", instance.NormalGame_GetGold, ES3Type_long.Instance);
|
||||
|
|
@ -101,6 +102,9 @@ namespace ES3Types
|
|||
case "ImageOpenStates_Right":
|
||||
instance.ImageOpenStates_Right = reader.Read<System.Boolean[]>(ES3Type_boolArray.Instance);
|
||||
break;
|
||||
case "HeartImageOpen":
|
||||
instance.HeartImageOpen = reader.Read<System.Boolean[]>(ES3Type_boolArray.Instance);
|
||||
break;
|
||||
case "UnlockProgress":
|
||||
instance.UnlockProgress = reader.Read<System.Int64[]>(ES3Type_longArray.Instance);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ namespace CodeJay
|
|||
public int InterstitialADCount;
|
||||
|
||||
public bool[] ImageOpenStates_Left, ImageOpenStates_Right;
|
||||
public bool[] HeartImageOpen;
|
||||
public long[] UnlockProgress;
|
||||
|
||||
public int NormalGameLevel;
|
||||
|
|
@ -72,10 +73,12 @@ namespace CodeJay
|
|||
|
||||
if (ImageOpenStates_Left == null) ImageOpenStates_Left = new bool[DB_HuntingData.CountEntities >> 1];
|
||||
if (ImageOpenStates_Right == null) ImageOpenStates_Right = new bool[DB_HuntingData.CountEntities >> 1];
|
||||
if (HeartImageOpen == null) HeartImageOpen = new bool[DB_HuntingData.CountEntities >> 1];
|
||||
|
||||
for (int i = 0; i < ImageOpenStates_Left.Length; i++) ImageOpenStates_Left[i] = false;
|
||||
ImageOpenStates_Left[0] = true; // 최초 앨범 오픈
|
||||
for (int i = 0; i < ImageOpenStates_Right.Length; i++) ImageOpenStates_Right[i] = false;
|
||||
for (int i = 0; i < HeartImageOpen.Length; i++) HeartImageOpen[i] = false;
|
||||
|
||||
if (this.UnlockProgress == null)
|
||||
this.UnlockProgress = new long[Defines.Constants.AI_IMAGE_NUMBER];
|
||||
|
|
@ -123,6 +126,10 @@ namespace CodeJay
|
|||
for (int i = 0; i < ImageOpenStates_Right.Length; i++)
|
||||
if (data.ImageOpenStates_Right.Length > i)
|
||||
ImageOpenStates_Right[i] = data.ImageOpenStates_Right[i];
|
||||
if (data.HeartImageOpen != null)
|
||||
for (int i = 0; i < HeartImageOpen.Length; i++)
|
||||
if (data.HeartImageOpen.Length > i)
|
||||
HeartImageOpen[i] = data.HeartImageOpen[i];
|
||||
|
||||
if (data.UnlockProgress != null)
|
||||
{
|
||||
|
|
@ -536,6 +543,15 @@ public partial class DBManager : MonoBehaviour
|
|||
return saveData.ImageOpenStates_Left.Length - 1;
|
||||
}
|
||||
|
||||
public bool CanBuyHeartImage(int group)
|
||||
{
|
||||
return saveData.HeartImageOpen[group] == false;
|
||||
}
|
||||
public void UnlockHeartImage(int group)
|
||||
{
|
||||
saveData.HeartImageOpen[group] = true;
|
||||
}
|
||||
|
||||
public int GetUnlockHuntingCount()
|
||||
{
|
||||
for (int i = 0; i < saveData.ImageOpenStates_Left.Length; i++)
|
||||
|
|
|
|||
|
|
@ -22,27 +22,51 @@ public class CollectionCard : CardBase
|
|||
t_price.text = left ? m_Data.NeedKey.ToString() : m_Data.NeedHeart.ToString();
|
||||
if (left) { go_pricedia.SetActive(true); go_priceheart.SetActive(false); }
|
||||
else { go_pricedia.SetActive(false); go_priceheart.SetActive(true); }
|
||||
var unlockTargetIndex = GameManager.DB.GetUnlockTargetIndex(left);
|
||||
i_face.color = Color.white;
|
||||
i_face.material = null;
|
||||
i_face.color = Color.white;
|
||||
go_buybtn.SetActive(false);
|
||||
if (m_Data.n_Group == unlockTargetIndex)
|
||||
{ // 구매 가능
|
||||
go_buybtn.SetActive(true);
|
||||
i_face.material = mat_blur;
|
||||
go_lock.SetActive(true);
|
||||
Heart_Right.SetActive(!left);
|
||||
}
|
||||
else if (m_Data.n_Group > unlockTargetIndex)
|
||||
{ // 잠김
|
||||
go_lock.SetActive(true);
|
||||
i_face.color = Color.black;
|
||||
Heart_Right.SetActive(false);
|
||||
if (left)
|
||||
{
|
||||
var unlockTargetIndex = GameManager.DB.GetUnlockTargetIndex(left);
|
||||
if (m_Data.n_Group == unlockTargetIndex)
|
||||
{ // 구매 가능
|
||||
go_buybtn.SetActive(true);
|
||||
i_face.material = mat_blur;
|
||||
go_lock.SetActive(true);
|
||||
Heart_Right.SetActive(!left);
|
||||
}
|
||||
else if (m_Data.n_Group > unlockTargetIndex)
|
||||
{ // 잠김
|
||||
go_lock.SetActive(true);
|
||||
i_face.color = Color.black;
|
||||
Heart_Right.SetActive(false);
|
||||
}
|
||||
else
|
||||
{ // 열림
|
||||
go_lock.SetActive(false);
|
||||
Heart_Right.SetActive(!left);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // 열림
|
||||
go_lock.SetActive(false);
|
||||
Heart_Right.SetActive(!left);
|
||||
{
|
||||
if (m_Data.n_Group < GameManager.DB.GetUnlockTargetIndex(true) && GameManager.DB.CanBuyHeartImage(m_Data.n_Group))
|
||||
{ // 구매 가능
|
||||
go_buybtn.SetActive(true);
|
||||
i_face.material = mat_blur;
|
||||
go_lock.SetActive(true);
|
||||
Heart_Right.SetActive(true);
|
||||
}
|
||||
else if (!GameManager.DB.CanBuyHeartImage(m_Data.n_Group))
|
||||
{ // 열림
|
||||
go_lock.SetActive(false);
|
||||
Heart_Right.SetActive(true);
|
||||
}
|
||||
else
|
||||
{ // 잠김
|
||||
go_lock.SetActive(true);
|
||||
i_face.color = Color.black;
|
||||
Heart_Right.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -120,24 +120,42 @@ public class HuntingSlot : CardBase
|
|||
AI_Right.material = null;
|
||||
if (_data_right != null)
|
||||
{
|
||||
if (_data_right.n_Group == unlockTargetIndex_right)
|
||||
if (_data_right.n_Group < unlockTargetIndex_left && GameManager.DB.CanBuyHeartImage(_data_right.n_Group))
|
||||
{ // 구매 가능
|
||||
gos_openbutton[1].SetActive(true);
|
||||
AI_Right.material = mat_blur;
|
||||
Block_Right.SetActive(true);
|
||||
Heart_Right.SetActive(true);
|
||||
}
|
||||
else if (_data_right.n_Group > unlockTargetIndex_right)
|
||||
{ // 잠김
|
||||
Block_Right.SetActive(true);
|
||||
AI_Right.color = Color.black;
|
||||
Heart_Right.SetActive(false);
|
||||
}
|
||||
else
|
||||
else if (!GameManager.DB.CanBuyHeartImage(_data_right.n_Group))
|
||||
{ // 열림
|
||||
Block_Right.SetActive(false);
|
||||
Heart_Right.SetActive(true);
|
||||
}
|
||||
else
|
||||
{ // 잠김 (순차적이 아니라 원하는 곳을 열 수 있으므로 데이터 구조 변경 필요)
|
||||
Block_Right.SetActive(true);
|
||||
AI_Right.color = Color.black;
|
||||
Heart_Right.SetActive(false);
|
||||
}
|
||||
//if (_data_right.n_Group == unlockTargetIndex_right)
|
||||
//{ // 구매 가능
|
||||
// gos_openbutton[1].SetActive(true);
|
||||
// AI_Right.material = mat_blur;
|
||||
// Block_Right.SetActive(true);
|
||||
// Heart_Right.SetActive(true);
|
||||
//}
|
||||
//else if (_data_right.n_Group > unlockTargetIndex_right)
|
||||
//{ // 잠김
|
||||
// Block_Right.SetActive(true);
|
||||
// AI_Right.color = Color.black;
|
||||
// Heart_Right.SetActive(false);
|
||||
//}
|
||||
//else
|
||||
//{ // 열림
|
||||
// Block_Right.SetActive(false);
|
||||
// Heart_Right.SetActive(true);
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -176,45 +194,62 @@ public class HuntingSlot : CardBase
|
|||
{
|
||||
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
||||
|
||||
if (GameManager.DB.IsAllUnlocked(left) == false)
|
||||
if (left)
|
||||
{
|
||||
var bCondition = false;
|
||||
if (left)
|
||||
if (GameManager.DB.IsAllUnlocked(left) == false)
|
||||
{
|
||||
if (GameManager.DB.Key >= _data_left.NeedKey)
|
||||
var bCondition = false;
|
||||
if (left)
|
||||
{
|
||||
GameManager.DB.SubKey(_data_left.NeedKey, this.name);
|
||||
bCondition = true;
|
||||
if (GameManager.DB.Key >= _data_left.NeedKey)
|
||||
{
|
||||
GameManager.DB.SubKey(_data_left.NeedKey, this.name);
|
||||
bCondition = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.UI.ShowNStackPopup(EPopupType.KeyChargePopup);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.UI.ShowNStackPopup(EPopupType.KeyChargePopup);
|
||||
if (GameManager.DB.Heart >= _data_right.NeedHeart)
|
||||
{
|
||||
GameManager.DB.SubHeart(_data_right.NeedHeart, this.name);
|
||||
bCondition = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
||||
}
|
||||
}
|
||||
if (bCondition)
|
||||
{
|
||||
GameManager.DB.UnlockLastAIImage(left);
|
||||
GameManager.DB.SaveDatas();
|
||||
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeAIChllengeModeAIData);
|
||||
|
||||
//BGId huntingDataID = GameManager.BGDatabase.GetLastUnolockHuntingDataID();
|
||||
//BGId huntingListDataID = GameManager.BGDatabase.GetLastUnolockHuntingListDataID();
|
||||
//if (huntingDataID != BGId.Empty && huntingListDataID != BGId.Empty)
|
||||
//{
|
||||
// GameManager.Event.InvokeEvent(EEventType.OnClickFullView, huntingDataID, huntingListDataID);
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameManager.DB.Heart >= _data_right.NeedHeart)
|
||||
{
|
||||
GameManager.DB.SubHeart(_data_right.NeedHeart, this.name);
|
||||
GameManager.DB.UnlockHeartImage(_data_right.n_Group);
|
||||
GameManager.DB.SaveDatas();
|
||||
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeAIChllengeModeAIData);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GameManager.DB.Heart >= _data_right.NeedHeart)
|
||||
{
|
||||
GameManager.DB.SubHeart(_data_right.NeedHeart, this.name);
|
||||
bCondition = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
||||
}
|
||||
}
|
||||
if (bCondition)
|
||||
{
|
||||
GameManager.DB.UnlockLastAIImage(left);
|
||||
GameManager.DB.SaveDatas();
|
||||
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeAIChllengeModeAIData);
|
||||
|
||||
//BGId huntingDataID = GameManager.BGDatabase.GetLastUnolockHuntingDataID();
|
||||
//BGId huntingListDataID = GameManager.BGDatabase.GetLastUnolockHuntingListDataID();
|
||||
//if (huntingDataID != BGId.Empty && huntingListDataID != BGId.Empty)
|
||||
//{
|
||||
// GameManager.Event.InvokeEvent(EEventType.OnClickFullView, huntingDataID, huntingListDataID);
|
||||
//}
|
||||
GameManager.UI.ShowNStackPopup(EPopupType.HeartChargePopup);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -223,18 +258,25 @@ public class HuntingSlot : CardBase
|
|||
{
|
||||
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
||||
|
||||
var unlockTargetIndex = GameManager.DB.GetUnlockTargetIndex(left);
|
||||
var group = left ? _data_left.n_Group : _data_right.n_Group;
|
||||
if (left)
|
||||
{
|
||||
var unlockTargetIndex = GameManager.DB.GetUnlockTargetIndex(left);
|
||||
var group = left ? _data_left.n_Group : _data_right.n_Group;
|
||||
|
||||
if (group == unlockTargetIndex)
|
||||
{ // 구매 가능
|
||||
if (group == unlockTargetIndex)
|
||||
{ // 구매 가능
|
||||
}
|
||||
else if (group > unlockTargetIndex)
|
||||
{ // 잠김
|
||||
}
|
||||
else
|
||||
{ // 열림
|
||||
GameObject.Find("AlbumPanel").GetComponent<HuntingPanel>().ShowPanel(left ? _data_left : _data_right);
|
||||
}
|
||||
}
|
||||
else if (group > unlockTargetIndex)
|
||||
{ // 잠김
|
||||
}
|
||||
else
|
||||
{ // 열림
|
||||
GameObject.Find("AlbumPanel").GetComponent<HuntingPanel>().ShowPanel(left ? _data_left : _data_right);
|
||||
else if (!GameManager.DB.CanBuyHeartImage(_data_right.n_Group))
|
||||
{
|
||||
GameObject.Find("AlbumPanel").GetComponent<HuntingPanel>().ShowPanel(_data_right);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue