コード例 #1
0
        /// <summary>
        /// 真正的消除了
        /// </summary>
        private void _Pop()
        {
            //计分
            if (IsNormalOrSpecial)
            {
                MyGrid.AddComboAmountOne();
                int addEnergy;
                if (0 <= Genre && Genre < GameData.CandyEnergyList.Length)
                {
                    addEnergy = GameData.CandyEnergyList[Genre] * MyGrid.CurrentComboMultiple;
                }
                else
                {
                    addEnergy = 1;
                }
                GameManager.Instance.PopEffectContainer.NormalPopEffect(CurIJ, Genre); //普通消除特效
                EnergyLightSpot.Create(CurIJ, addEnergy);                              //能量光点
                //if (MyGrid.CurrentComboMultiple > 1)
                //{
                //    GameManager.Instance.CellEffectContainer.CreateAddComboLabel(MyGrid.GetCellPosition(CurIJ),
                //                                                                 MyGrid.CurrentComboMultiple);
                //}
            }
            else if (MyType == CandyType.Item)
            {
                switch (Genre)
                {
                case 202:
                    GameData.MyHealth += 300;
                    break;

                case 203:
                    EnergyLightSpot.Create(CurIJ, 50);
                    break;

                case 204:
                    //TODO:钱袋
                    break;
                }
            }

            if (MyGrid[CurIJ].MyCandy == this)
            {
                MyGrid[CurIJ].MyCandy = null;
            }

            //if (MyType == CandyType.H)
            //{
            //    GameManager.Instance.PopEffectContainer.StripeHSpecialPopEffect(CurIJ, Genre);
            //}
            //else if (MyType == CandyType.V)
            //{
            //    GameManager.Instance.PopEffectContainer.StripeVSpecialPopEffect(CurIJ, Genre);
            //}
            //else if (MyType == CandyType.Bomb)
            //{
            //    if (FiredBombRange < 4)
            //    {
            //        GameManager.Instance.PopEffectContainer.Bomb3SpecialPopEffect(CurIJ, Genre);
            //    }
            //    else
            //    {
            //        GameManager.Instance.PopEffectContainer.Bomb5SpecialPopEffect(CurIJ, Genre);
            //    }
            //}

            //消除音效
            AudioManager.PlayRandomOneShot(0.2f, PopAudios);

            CandyPool.Enqueue(gameObject, 1f);
        }