示例#1
0
        // Crush block funtion
        override public void  BlockCrush(bool force)
        {
            if (destroying)
            {
                return;
            }
            if (eventCountBorn == SessionControl.Instance.eventCount && !force)
            {
                return;
            }

            eventCountBorn = SessionControl.Instance.eventCount;
            level--;
            FieldAssistant.Instance.field.blocks[slot.Row, slot.Col] = level;
            if (level == 0)
            {
                slot.gravity = true;
//	            slot.SetScore(1);
                slot.SetBlock(null);
                SlotGravity.Reshading();
                StartCoroutine(DestroyingRoutine());
                return;
            }
            if (level > 0)
            {
                anim.Play("BlockCrush");
//	            AudioAssistant.Shot("BlockHit");
                _uiSprite.spriteName = spritesName[level - 1];
            }
        }
示例#2
0
//		private Dragon _dragon;


        #region implemented abstract members of BlockInterface

        // Crush block funtion
        override public void  BlockCrush(bool force)
        {
            if (destroying)
            {
                return;
            }
            if (eventCountBorn == SessionControl.Instance.eventCount && !force)
            {
                return;
            }
            eventCountBorn = SessionControl.Instance.eventCount;
            //		level --;
            //FieldAssistant.Instance.field.blocks[slot.Row, slot.Col] = level;

            if (level == 0)
            {
                slot.gravity = true;
//	            slot.SetScore(1);
                slot.SetBlock(null);
                SlotGravity.Reshading();
                StartCoroutine(DestroyingRoutine());
                return;
            }

            if (level > 0)
            {
//				if(_dragon == null)
//					_dragon = FindObjectOfType<Dragon>();
//
//				if(_dragon == null) return;
//				_dragon.TakeDamage(Dragon.DamageConst);
//	//			anim.Play("BlockCrush");
//	//            AudioAssistant.Shot("BlockHit");
//				_dragon.IsPlayHitAnim = true;//PlayAnim(Dragon.E_DragonAnim.get_hit_front);
//
//	//			sr.sprite = sprites[level-1];

                //MyFrameWork.NetworkManager.Instance.ClientSendFightDataMsg(33);
                FightControl.Instance.AttackBoss();
//				if(_dragon == null)
//					_dragon = FindObjectOfType<Dragon>();
//
//				if(_dragon == null) return;

//				_dragon.IsPlayHitAnim = true;
//				_dragon.PlayAnim(Dragon.E_DragonAnim.get_hit_front);

//				//test
//				Protocol.ServerFightResult s2c = new Protocol.ServerFightResult();
//				s2c.result = Protocol.Result.FIGHT_WIN;
//				MyFrameWork.EventDispatcher.TriggerEvent<Protocol.MsgNo, Protocol.ServerFightResult>(Protocol.MsgNo.SERVER_FIGHT_RESULT.ToString(), Protocol.MsgNo.SERVER_FIGHT_RESULT, s2c);
            }
        }
示例#3
0
        public override void BlockCrush(bool force)
        {
            if (eventCountBorn == SessionControl.Instance.eventCount && !force)
            {
                return;
            }
            if (destroying)
            {
                return;
            }
            eventCountBorn = SessionControl.Instance.eventCount;
            GameObject o = ResourceMgr.Instance.LoadAndInstanceGameObjectFromPreload(crushEffect);

            o.transform.position = transform.position;
            slot.gravity         = true;
//	        slot.SetScore(1);
            SlotGravity.Reshading();
            Destroy(gameObject);
            return;
        }
示例#4
0
        IEnumerator DestroyingRoutine()
        {
            destroying = true;

            GameObject o = ResourceMgr.Instance.LoadAndInstanceGameObjectFromPreload(crushEffect);

            o.transform.position = transform.position;

//	        AudioAssistant.Shot("WeedCrush");
            anim.Play("JellyDestroy");
            while (anim.isPlaying)
            {
                yield return(0);
            }

            slot.gravity = true;
            slot.SetBlock(null);
            SlotGravity.Reshading();
            Destroy(gameObject);
        }
示例#5
0
        // Field generator
        public IEnumerator CreateField()
        {
            //Utils.waitingStatus = "Level loading";
            DebugUtil.Info("Level loading");

            //删除原先布局,稍后用对象池
            SlotManager.Instance.DestroyAllSlot();

            if (GameEntrance.Instance.IsTestFight)
            {
                FightControl.Instance.EFightStatus = E_FightStatus.LoadingBoss3;

                field           = new MatchField(LevelProfile.CurrentLevelProfile.Width, LevelProfile.CurrentLevelProfile.Height);
                field.chipCount = LevelProfile.CurrentLevelProfile.CardCount;

                yield return(StartCoroutine(GenerateSlots()));

                _goSlotCreateBoss3.SetActive(true);

                yield return(StartCoroutine(GenerateBlocks()));

                SlotManager.Instance.Initialize();

                yield return(StartCoroutine(GenerateWalls()));

                SlotGravity.Reshading();

                //			yield return StartCoroutine(GenerateJelly());
                yield return(StartCoroutine(GenerateChips()));

                yield return(StartCoroutine(GeneratePowerups()));

                UIMgr.Instance.DestroyUI(E_UIType.UIMainPanel);

                MusicManager.Instance.PlaySoundEff("Music/readyGo");



                FightControl.Instance.EFightStatus = E_FightStatus.FightBoss3;
            }
            else
            {
                for (int i = 0; i < FightControl.Instance.ModuleFight.LevelId.Length; i++)
                {
                    if (i == 0)
                    {
                        FightControl.Instance.EFightStatus = E_FightStatus.LoadingBoss1;
                    }
                    else if (i == 1)
                    {
                        FightControl.Instance.EFightStatus = E_FightStatus.LoadingBoss2;
                    }
                    else
                    {
                        FightControl.Instance.EFightStatus = E_FightStatus.LoadingBoss3;
                    }

                    field           = new MatchField(LevelProfile.CurrentLevelProfile.Width, LevelProfile.CurrentLevelProfile.Height);
                    field.chipCount = LevelProfile.CurrentLevelProfile.CardCount;

                    yield return(StartCoroutine(GenerateSlots()));

                    yield return(StartCoroutine(GenerateBlocks()));

                    SlotManager.Instance.Initialize();

                    yield return(StartCoroutine(GenerateWalls()));

                    SlotGravity.Reshading();

                    //			yield return StartCoroutine(GenerateJelly());
                    yield return(StartCoroutine(GenerateChips()));

                    yield return(StartCoroutine(GeneratePowerups()));
                }

                FightControl.Instance.EFightStatus = E_FightStatus.PreviewScene;
            }


//			SUBoosterButton.Generate(Slot.folder);
        }