RandomGFGoStop/Assets/Scripts/UI/GamePanel/GamePanel.cs

759 lines
23 KiB
C#
Raw Normal View History

2025-09-01 03:29:18 +00:00
using CodeJay.Enum;
2025-08-27 21:08:17 +00:00
using System.Collections.Generic;
2025-09-04 05:54:48 +00:00
using System.Linq;
2025-08-27 21:08:17 +00:00
using UnityEngine;
2025-09-01 03:29:18 +00:00
using Image = UnityEngine.UI.Image;
2025-08-27 21:08:17 +00:00
public partial class GamePanel : MonoBehaviour
{
#region Statics
public static void LogicalError(string message)
{
Debug.LogError(message);
2025-08-27 21:08:17 +00:00
}
#endregion
public static float GameSpeed = 1f;
public static GamePanel Instance;
2025-09-16 03:19:51 +00:00
public GameObject CardSlotPrefab, go_toppanel, go_previewbtn, go_missionbtn;
2025-08-27 21:08:17 +00:00
public CanvasGroup cg;
2025-09-01 03:29:18 +00:00
public Image i_ai;
2025-09-01 07:07:58 +00:00
public TMPro.TextMeshProUGUI AINameTMP, t_PointMoney;
2025-08-27 21:08:17 +00:00
public TMPro.TextMeshProUGUI AIGoldTMP;
private List<CardSlot> _lstCardSlots;
private int _prevScore_Player = 0;
private int _prevScore_AI = 0;
private bool _isFirstTurn_Player = true;
private bool _isFirstTurn_AI = true;
private float _delay = 0f;
public bool IsChallengeMode { get; private set; } = false;
public GamePanel_Effect EffectPanel { get; private set; } = null;
private bool _isSelctedSepYulggetState = false;
public bool UseSepYulgget_To_Pee { get; set; } = false;
public int Player_Bell { get; set; } = 0;
2025-08-30 21:09:29 +00:00
public int Player_Milgi { get; set; } = 0;
2025-08-27 21:08:17 +00:00
public int AI_Bell { get; set; } = 0;
public int Player_Bbug { get; set; } = 0;
public int AI_Bbug { get; set; } = 0;
public int Player_Go { get; set; } = 0;
public int AI_Go { get; set; } = 0;
public bool PlayerTurn { get; set; } = true;
public bool GameOver { get; set; } = true;
public int Stake { get; set; } = 100;
2025-09-03 20:40:30 +00:00
public bool IsPreview { get; set; } = false;
2025-08-27 21:08:17 +00:00
2025-09-04 05:54:48 +00:00
public Dictionary<eMainMission, int> dic_missionRate = new Dictionary<eMainMission, int>
2025-09-04 05:05:15 +00:00
{
{ eMainMission.Godori, 5 },
{ eMainMission.Chodan, 3 },
{ eMainMission.Hongdan, 3 },
{ eMainMission.Chungdan, 3 },
{ eMainMission.Gwang5, 10 },
{ eMainMission.Gwang4, 5 },
{ eMainMission.All_1, 4 },
{ eMainMission.All_2, 4 },
{ eMainMission.All_3, 4 },
{ eMainMission.All_4, 4 },
{ eMainMission.All_5, 4 },
{ eMainMission.All_6, 4 },
{ eMainMission.All_7, 4 },
{ eMainMission.All_8, 4 },
{ eMainMission.All_9, 4 },
{ eMainMission.All_10, 4 },
{ eMainMission.All_11, 4 },
2025-09-06 00:34:59 +00:00
{ eMainMission.All_12, 4 },
{ eMainMission.Max, 0 }
2025-09-04 05:05:15 +00:00
};
2025-09-04 05:54:48 +00:00
public Dictionary<eSubMission, int> dic_submisstionRate = new Dictionary<eSubMission, int>
2025-09-04 05:05:15 +00:00
{
{ eSubMission.Dobule3, 3 },
{ eSubMission.YulGgeut3, 3 },
{ eSubMission.Ddee3, 3 },
{ eSubMission.Gwang3, 3 },
2025-09-06 00:34:59 +00:00
{ eSubMission.Be3Gwang, 2 },
{ eSubMission.Max, 0 }
2025-09-04 05:05:15 +00:00
};
2025-09-04 05:54:48 +00:00
public eMainMission CurMission = eMainMission.Max;
2025-09-04 23:20:04 +00:00
bool ShowMainMissionPopup = false;
2025-09-04 05:54:48 +00:00
public eSubMission CurSubMission = eSubMission.Max;
2025-09-04 23:20:04 +00:00
bool ShowSubMissionPopup = false;
2025-09-04 05:05:15 +00:00
2025-08-27 21:08:17 +00:00
#region MonoBehaviour
private void Awake()
{
if (Instance == null)
Instance = this;
else
Debug.LogError("Error!!!!");
EffectPanel = this.GetComponent<GamePanel_Effect>();
if (GameManager.Instance != null)
{
GameManager.Event.RegistEvent(EEventType.OnStartNormalGame, this.StartNormalGame);
GameManager.Event.RegistEvent(EEventType.OnChallengeStart, this.OnChallengeStart);
GameManager.Event.RegistEvent(EEventType.OnReturnToHome, this.ReturnToHome);
GameManager.Event.RegistEvent(EEventType.OnReturnToHunting, this.OnReturnToHunting);
GameManager.Event.RegistEvent(EEventType.OnGameEnd, this.OnGameEnd);
GameManager.Event.RegistEvent(EEventType.OnSynchronizeNormalGameData, this.UpdateAIGold);
}
if (_hashScoreMultiplyTypes == null)
_hashScoreMultiplyTypes = new HashSet<EScoreMutiplyType>();
_hashScoreMultiplyTypes.Clear();
_dicCoroutineStates = new Dictionary<EGameWorkFlowType, EGameStateType>();
for (EGameWorkFlowType i = 0; i < EGameWorkFlowType.Max; i++)
_dicCoroutineStates.Add(i, EGameStateType.None);
GameSpeed = GameManager.DB.GameSpeed;
2025-08-27 21:08:17 +00:00
}
private void Start()
{
this.GamePanelEnabled(false);
}
private void OnDestroy()
{
if (GameManager.Instance != null)
{
GameManager.Event.RemoveEvent(EEventType.OnStartNormalGame, this.StartNormalGame);
GameManager.Event.RemoveEvent(EEventType.OnChallengeStart, this.OnChallengeStart);
GameManager.Event.RemoveEvent(EEventType.OnReturnToHome, this.ReturnToHome);
GameManager.Event.RemoveEvent(EEventType.OnReturnToHunting, this.OnReturnToHunting);
GameManager.Event.RemoveEvent(EEventType.OnGameEnd, this.OnGameEnd);
GameManager.Event.RemoveEvent(EEventType.OnSynchronizeNormalGameData, this.UpdateAIGold);
}
for (int i = 0; i < _lstCardSlots.Count; i++)
{
_lstCardSlots[i].DestroyCardSlot();
}
}
private void Update()
{
//if (Input.GetKeyDown(KeyCode.S))
// this.ShowLog();
if (GameOver)
{
return;
}
if (_delay > 0f)
_delay -= Time.deltaTime * GameSpeed;
else
{
_delay = 0f;
switch (CurrentCoroutineType)
{
case EGameWorkFlowType.DistributeCard:
this.DistributeStateMachine();
break;
case EGameWorkFlowType.DiscardNEffectBeforeDiscard:
this.DiscardStateMachine();
break;
case EGameWorkFlowType.CheckMatchedCardAfterDiscard:
this.CheckDiscardMatchedStateMachine();
break;
case EGameWorkFlowType.FlipCenterCard:
this.FlipCenterStateMachine();
break;
case EGameWorkFlowType.BringTheGetableCards:
this.BringGetableStateMachine();
break;
case EGameWorkFlowType.CheckCombination:
Debug.Log("CheckCombination Method!");
CurrentCoroutineType = EGameWorkFlowType.Max;
StartCoroutine(coroCheckCombination());
break;
case EGameWorkFlowType.CheckEndOrGoStop:
Debug.Log("CheckEndOrGoStop Method!");
CurrentCoroutineType = EGameWorkFlowType.Max;
StartCoroutine(coroCheckEndOrGoStop());
break;
}
}
}
#endregion
private void GamePanelEnabled(bool b)
{
if (gameObject.activeInHierarchy != b)
this.gameObject.SetActive(b);
}
private void StartNormalGame()
{
//GameManager.Flamingo.Flamingo.StartPlaySession(GameManager.DB.NormalGameLevel.ToString(), "Normal");
GameManager.Sound.PlaySFX(ESFXType.Start_1);
IsChallengeMode = false;
GameManager.DB.MinInterstitialADCount(1);
// Get Highest Clear level
var data = DB_HuntingData.GetEntity((GameManager.DB.GetUnlockTargetIndex(true) << 1) - 2);
Stake = data.DBF_Stake;
2025-08-27 21:08:17 +00:00
this.UpdateAIGold();
this.Initialize();
this.Shuffle();
this.FrontBonusCard();
this.SetGuideData(false);
this.EnabledPlayerHandRaycast(false);
_delay = 0.2f;
GameOver = false;
CurrentCoroutineType = EGameWorkFlowType.DistributeCard;
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGameData);
}
private void ReturnToHome()
{
GameManager.Sound.PlayBGM(EBGMType.BGM_1);
this.GamePanelEnabled(false);
ECardType type = 0;
for (int i = _lstCardSlots.Count - 1; i >= 0; i--)
{
if (_lstCardSlots[i].CardType == ECardType.FlipCard_1 || _lstCardSlots[i].CardType == ECardType.FlipCard_2)
{
CardSlot slot = _lstCardSlots[i];
_lstCardSlots.RemoveAt(i);
Destroy(slot.gameObject);
}
else
{
_lstCardSlots[i].Initialize(CenterDeckRT);
_lstCardSlots[i].SetData(type++);
}
}
GameOver = true;
}
private void OnReturnToHunting()
{
GameManager.Sound.PlayBGM(EBGMType.BGM_1);
this.GamePanelEnabled(false);
ECardType type = 0;
for (int i = _lstCardSlots.Count - 1; i >= 0; i--)
{
if (_lstCardSlots[i].CardType == ECardType.FlipCard_1 || _lstCardSlots[i].CardType == ECardType.FlipCard_2)
{
CardSlot slot = _lstCardSlots[i];
_lstCardSlots.RemoveAt(i);
Destroy(slot.gameObject);
}
else
{
_lstCardSlots[i].Initialize(CenterDeckRT);
_lstCardSlots[i].SetData(type++);
}
}
GameOver = true;
}
public void StartNextGame()
{
// 두배면 두배 이펙트 실행
if(_hashScoreMultiplyTypes.Contains(EScoreMutiplyType.ClickedFromResultPopup))
{
EffectPanel.Direct(EEffectDirectType.Double, true);
}
if (IsChallengeMode)
GameManager.Event.InvokeEvent(EEventType.OnChallengeStart);
else
GameManager.Event.InvokeEvent(EEventType.OnStartNormalGame);
}
public void AddMultiplyType(EScoreMutiplyType type)
{
switch (type)
{
2025-08-30 21:09:29 +00:00
case EScoreMutiplyType.Go:
2025-08-27 21:08:17 +00:00
case EScoreMutiplyType.Gobak:
case EScoreMutiplyType.Peebak:
case EScoreMutiplyType.Gwhangbak:
case EScoreMutiplyType.Shake:
case EScoreMutiplyType.Nagari:
case EScoreMutiplyType.ClickedFromResultPopup:
2025-09-03 03:33:00 +00:00
case EScoreMutiplyType.MeongTeonguri:
2025-09-04 23:20:04 +00:00
case EScoreMutiplyType.MainMission:
case EScoreMutiplyType.SubMission:
2025-08-27 21:08:17 +00:00
_hashScoreMultiplyTypes.Add(type);
break;
case EScoreMutiplyType.Max:
break;
}
}
private void OnGameEnd()
{
if(IsChallengeMode)
{
//GameManager.Flamingo.Flamingo.EndPlaySession(GameManager.DB.GetUnlockTargetIndex().ToString(), "Hunting");
}
else
{
//GameManager.Flamingo.Flamingo.EndPlaySession(GameManager.DB.NormalGameLevel.ToString(), "Normal");
}
GameOver = true;
CurrentCoroutineType = EGameWorkFlowType.Max;
ResetScortMultiplyType();
for (int i = 0; i < _lstCardSlots.Count; i++)
{
_lstCardSlots[i].transform.SetParent(CenterDeckRT);
}
}
private void OnChallengeStart()
{
2025-08-29 13:01:17 +00:00
////GameManager.Flamingo.Flamingo.StartPlaySession(GameManager.DB.GetUnlockTargetIndex().ToString(), "Hunting");
//GameManager.Sound.PlaySFX(ESFXType.Start_1);
//IsChallengeMode = true;
//// Get Highest Clear level
//var data = GameManager.DB.GetHuntingData(GameManager.DB.GetUnlockTargetIndex());
//this.UpdateAIGold();
//Stake = data.Stake;
//this.Initialize();
//this.Shuffle();
//this.FrontBonusCard();
//this.SetGuideData(false);
//this.EnabledPlayerHandRaycast(false);
//_delay = 0.2f;
//GameOver = false;
//CurrentCoroutineType = EGameWorkFlowType.DistributeCard;
//GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGameData);
2025-08-27 21:08:17 +00:00
}
public void ResetScortMultiplyType()
{
_hashScoreMultiplyTypes.Clear();
if (Player_Milgi > 0) AddMultiplyType(EScoreMutiplyType.ClickedFromResultPopup);
2025-08-27 21:08:17 +00:00
}
public void UpdateAIGold()
{
if (IsChallengeMode)
{
2025-08-29 13:01:17 +00:00
var data = GameManager.DB.GetHuntingData(GameManager.DB.GetUnlockTargetIndex(true));
2025-08-27 21:08:17 +00:00
AINameTMP.text = data.Name;
AIGoldTMP.text = GameManager.DB.GetReaminingTargetConditionString(data.Index);
}
else
{
AINameTMP.text = "Lv." + GameManager.DB.NormalGameLevel.ToString();
AIGoldTMP.text = CodeJay.CodeJayUtility.Converter.MoneyToString(GameManager.DB.GetRemainigNormalGameAIGold());
}
}
public void UnintentionalDestroyOfCardSlot(CardSlot slot)
{
for (int i = 0; i < _lstCardSlots.Count; i++)
{
if (_lstCardSlots[i].CardType == slot.CardType)
{
_lstCardSlots[i] = slot;
return;
}
}
}
2025-09-03 05:46:23 +00:00
public void OnClick_Preview()
{
GameManager.UI.ShowNStackPopup(EPopupType.PreViewPopup);
}
2025-09-04 05:05:15 +00:00
void Set_Mission()
{
2025-09-07 00:06:52 +00:00
if (DSUtil.RandomTrue(0.1f + GameManager.DB.MissionAddRate))
2025-09-16 03:19:51 +00:00
//if (true) // 테스트 : 미션 100%
2025-09-04 05:05:15 +00:00
{
GameManager.DB.Set_Mission(false);
// 메인 미션
2025-09-04 05:54:48 +00:00
{
System.Random rand = new System.Random();
var keys = dic_missionRate.Keys
.Where(k => k != eMainMission.Max) // Max 제외
.ToList();
2025-09-04 05:54:48 +00:00
CurMission = keys[rand.Next(keys.Count)];
}
// 서브 미션
2025-09-04 05:54:48 +00:00
{
System.Random rand = new System.Random();
var keys = dic_submisstionRate.Keys
.Where(k => k != eSubMission.Max) // Max 제외
.ToList();
2025-09-04 05:54:48 +00:00
CurSubMission = keys[rand.Next(keys.Count)];
}
2025-09-16 03:19:51 +00:00
MissionOpenPopup.NeedBtn = true;
2025-09-04 05:54:48 +00:00
GameManager.UI.ShowNStackPopup(EPopupType.MissionOpenPopup);
2025-09-16 03:19:51 +00:00
go_missionbtn.SetActive(true);
2025-09-04 05:05:15 +00:00
}
else
2025-09-04 05:54:48 +00:00
{
CurMission = eMainMission.Max;
CurSubMission = eSubMission.Max;
2025-09-04 05:05:15 +00:00
GameManager.DB.Set_Mission(true);
2025-09-16 03:19:51 +00:00
go_missionbtn.SetActive(false);
2025-09-04 05:54:48 +00:00
}
go_previewbtn.SetActive(true);
2025-09-04 05:05:15 +00:00
}
2025-09-16 03:19:51 +00:00
public void OnClick_Mission()
{
MissionOpenPopup.NeedBtn = false;
GameManager.UI.ShowNStackPopup(EPopupType.MissionOpenPopup);
}
2025-08-27 21:08:17 +00:00
#region Core
private void Initialize()
{
GameManager.Sound.PlayBGM(EBGMType.BGM_2);
go_previewbtn.SetActive(false);
2025-09-16 03:19:51 +00:00
go_missionbtn.SetActive(false);
2025-09-04 23:20:04 +00:00
ShowMainMissionPopup = ShowSubMissionPopup = false;
2025-09-03 20:40:30 +00:00
IsPreview = UseSepYulgget_To_Pee = false;
2025-08-27 21:08:17 +00:00
this.GamePanelEnabled(true);
2025-09-01 03:29:18 +00:00
go_toppanel.SetActive(false);
2025-09-10 23:57:18 +00:00
i_ai.sprite = DB_HuntingData.GetEntity((GameManager.DB.GetUnlockTargetIndex(true) << 1) - 2).DBF_UnlockImage;
2025-09-01 07:07:58 +00:00
t_PointMoney.text = $"판돈\n<color=#ffd544>{Stake}</color>냥";
2025-08-27 21:08:17 +00:00
GameManager.Event.InvokeEvent(EEventType.OnInitializeGame);
GameManager.Event.InvokeEvent(EEventType.OnSynchronizeGold);
EffectPanel.PlayerTurnDirectEnabled(false);
if (_lstCardSlots == null)
{
_lstCardSlots = new List<CardSlot>();
for (ECardType i = 0; i < ECardType.Dec_Pee_2 + 1; i++)
{
CardSlot slot = Instantiate(CardSlotPrefab).GetComponent<CardSlot>();
slot.Initialize(CenterDeckRT);
_lstCardSlots.Add(slot);
}
// Use Bonus Card
{
// Bonus 1 (Double)
CardSlot slot = Instantiate(CardSlotPrefab).GetComponent<CardSlot>();
slot.Initialize(CenterDeckRT);
slot.SetData(ECardType.Bonus_1);
_lstCardSlots.Add(slot);
// Bonus 2 (Double)
slot = Instantiate(CardSlotPrefab).GetComponent<CardSlot>();
slot.Initialize(CenterDeckRT);
slot.SetData(ECardType.Bonus_2);
_lstCardSlots.Add(slot);
// Bonus 3 (Triple)
slot = Instantiate(CardSlotPrefab).GetComponent<CardSlot>();
slot.Initialize(CenterDeckRT);
slot.SetData(ECardType.Bonus_3);
_lstCardSlots.Add(slot);
}
}
else
{
for (int i = _lstCardSlots.Count - 1; i >= 0; i--)
{
if (_lstCardSlots[i].CardType == ECardType.FlipCard_1 || _lstCardSlots[i].CardType == ECardType.FlipCard_2)
{
CardSlot slot = _lstCardSlots[i];
_lstCardSlots.RemoveAt(i);
Destroy(slot.gameObject);
}
}
}
ECardType type = ECardType.Jan_Ghwang;
for (int i = 0; i < _lstCardSlots.Count; i++)
{
if (_lstCardSlots[i] != null)
{
_lstCardSlots[i].gameObject.name = "CardSlot " + (int)i;
_lstCardSlots[i].SetData(type++);
if (type == ECardType.Back)
type = ECardType.Bonus_1;
}
}
_isSelctedSepYulggetState = false;
_prevScore_Player = 0;
_prevScore_AI = 0;
_useBomb = false;
_isFirstTurn_Player = true;
_isFirstTurn_AI = true;
PlayerTurn = true;
GameOver = false;
Player_Bell = 0;
AI_Bell = 0;
Player_Bbug = 0;
AI_Bbug = 0;
Player_Go = 0;
AI_Go = 0;
_discardSlot = null;
for (EGameWorkFlowType i = 0; i < EGameWorkFlowType.Max; i++)
_dicCoroutineStates[i] = EGameStateType.None;
CurrentCoroutineType = EGameWorkFlowType.Max;
this.DataInitialize();
}
private void Shuffle()
{
List<int> indices = new List<int>();
for (int i = 0; i < _lstCardSlots.Count; i++)
indices.Add(i);
// Bomb Test
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(2);
//indices.Remove(3);
//indices.Remove(5);
//CardSlot temp = _lstCardSlots[3];
//_lstCardSlots[3] = _lstCardSlots[5];
//_lstCardSlots[5] = temp;
}
// Bell Test
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(2);
//indices.Remove(3);
//indices.Remove(9);
//CardSlot temp = _lstCardSlots[3];
//_lstCardSlots[3] = _lstCardSlots[9];
//_lstCardSlots[9] = temp;
}
// Get Bbug Test
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(2);
//indices.Remove(3);
//indices.Remove(5);
//indices.Remove(6);
//indices.Remove(7);
//CardSlot temp = _lstCardSlots[1];
//_lstCardSlots[1] = _lstCardSlots[5];
//_lstCardSlots[5] = temp;
//temp = _lstCardSlots[2];
//_lstCardSlots[2] = _lstCardSlots[6];
//_lstCardSlots[6] = temp;
//temp = _lstCardSlots[3];
//_lstCardSlots[3] = _lstCardSlots[7];
//_lstCardSlots[7] = temp;
}
// Select Test
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(5);
//indices.Remove(6);
//CardSlot temp = _lstCardSlots[1];
//_lstCardSlots[1] = _lstCardSlots[5];
//_lstCardSlots[5] = temp;
//temp = _lstCardSlots[2];
//_lstCardSlots[2] = _lstCardSlots[6];
//_lstCardSlots[6] = temp;
}
// Bonus Test In Player Hand
{
//indices.Remove(0);
//indices.Remove(47);
//CardSlot temp = _lstCardSlots[0];
//_lstCardSlots[0] = _lstCardSlots[48];
//_lstCardSlots[48] = temp;
}
// Bonus Test In Center
{
//indices.Remove(5);
//indices.Remove(48);
//CardSlot temp = _lstCardSlots[5];
//_lstCardSlots[5] = _lstCardSlots[48];
//_lstCardSlots[48] = temp;
}
// 총통 테스트
2025-08-27 21:08:17 +00:00
{
// Player (유저 총통 만들기, 안되고 폭탄만 만들어짐)
2025-08-27 21:08:17 +00:00
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(2);
//indices.Remove(3);
}
// Floor (바닥패를 총통으로 만들어 다음판 or 로비로)
2025-08-27 21:08:17 +00:00
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(2);
//indices.Remove(3);
//indices.Remove(5);
//indices.Remove(6);
//indices.Remove(7);
//indices.Remove(8);
//CardSlot temp = _lstCardSlots[0];
//_lstCardSlots[0] = _lstCardSlots[5];
//_lstCardSlots[5] = temp;
//temp = _lstCardSlots[1];
//_lstCardSlots[1] = _lstCardSlots[6];
//_lstCardSlots[6] = temp;
//temp = _lstCardSlots[2];
//_lstCardSlots[2] = _lstCardSlots[7];
//_lstCardSlots[7] = temp;
//temp = _lstCardSlots[3];
//_lstCardSlots[3] = _lstCardSlots[8];
//_lstCardSlots[8] = temp;
}
}
// Select Text
{
//indices.Remove(0);
//indices.Remove(1);
//indices.Remove(2);
//indices.Remove(3);
//indices.Remove(5);
//indices.Remove(6);
//// Set Floor
//CardSlot temp = _lstCardSlots[2];
//_lstCardSlots[2] = _lstCardSlots[5];
//_lstCardSlots[5] = temp;
//temp = _lstCardSlots[3];
//_lstCardSlots[3] = _lstCardSlots[6];
//_lstCardSlots[6] = temp;
//// Set AI Hand
//temp = _lstCardSlots[1];
//_lstCardSlots[1] = _lstCardSlots[9];
//_lstCardSlots[9] = temp;
}
// Bug Test
{
//indices.Remove(0);
//indices.Remove(5);
//indices.Remove(6);
//indices.Remove(12);
//indices.Remove(14);
//indices.Remove(15);
//CardSlot temp = _lstCardSlots[0];
//_lstCardSlots[0] = _lstCardSlots[15];
//_lstCardSlots[15] = temp;
//temp = _lstCardSlots[5];
//_lstCardSlots[5] = _lstCardSlots[12];
//_lstCardSlots[12] = temp;
//// Set AI Hand
//temp = _lstCardSlots[6];
//_lstCardSlots[6] = _lstCardSlots[14];
//_lstCardSlots[14] = temp;
}
for (int i = 0; i < _lstCardSlots.Count; i++)
{
int rnd = indices[UnityEngine.Random.Range(0, indices.Count)];
if (rnd == i || indices.Contains(i) == false)
continue;
CardSlot slot = _lstCardSlots[rnd];
_lstCardSlots[rnd] = _lstCardSlots[i];
_lstCardSlots[i] = slot;
}
}
private void FrontBonusCard()
{
for (int i = 0; i < _lstCardSlots.Count; i++)
{
if (_lstCardSlots[i].CardType == ECardType.Bonus_1 || _lstCardSlots[i].CardType == ECardType.Bonus_2 || _lstCardSlots[i].CardType == ECardType.Bonus_3)
{
CardSlot slot = _lstCardSlots[i];
_lstCardSlots[i] = _lstCardSlots[0];
_lstCardSlots[0] = slot;
break;
}
}
}
#endregion
}