private IEnumerator DelayCreateCompCards() { yield return(new WaitForSeconds(0.1f)); Dictionary <int, GameObject> dicInvisbileCards = GetRemainInvisibleCards(); if (dicInvisbileCards != null && dicInvisbileCards.Count > 0) { CardCompare cardCompare = new CardCompare(); List <int> keys = dicInvisbileCards.Keys.ToList(); keys.Sort(cardCompare); foreach (int key in keys) { GameObject gObj = null; if (!dicInvisbileCards.TryGetValue(key, out gObj)) { continue; } Sequence seq = Util.PlayRotation(gObj, 0.1f); Vector3 compCard = ComputerCardManager.GetInstance().GetPosCompCard(); seq.Append(gObj.transform.DOMove(compCard, 0.3f)); seq.OnComplete(() => { gObj.SetActive(false); if (SoundManager.getInstance()) { SoundManager.getInstance().PlaySound(SoundId.FLY); } if (ComputerCardManager.GetInstance() != null) { ComputerCardManager.GetInstance().OnCreateComCard(key); } }); yield return(new WaitForSeconds(0.5f)); } } }
private void Awake() { instance = this; }