//######################################################被击动作接口####################################################
        //被击结束回调
        private void HurtEnd()
        {
            ObjectCreature pCaster = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject);

            if (pCaster == null)
            {
                return;
            }

            switch (pCaster.GetActionState())
            {
            case ObjectCreature.ObjectActionState.Hurting:
            {
                if (pCaster.GetCacheLastActionState() == ObjectCreature.ObjectActionState.dizzy && pCaster.IsInFightState(EM_FIGHT_STATE.EM_FIGHT_STATE_VERTIGO))
                {
                    //重置回眩晕中 [10/19/2015 Zmy]
                    pCaster.SetObjectActionState(ObjectCreature.ObjectActionState.dizzy);
                }
                else
                {
                    pCaster.SetObjectActionState(ObjectCreature.ObjectActionState.normalAttack);
                }
            }
            break;

            case ObjectCreature.ObjectActionState.checkHurting:
            {
                //受击结束播放一次不带事件回调的待机动画,用于可以在checkHurting状态下可以再次播放受击动作 [9/28/2015 Zmy]
                if (pCaster is ObjectHero)
                {
                    ObjectHero obj = pCaster as ObjectHero;
                    obj.GetAnimation().Anim_Fidle(false);
                }
                else
                {
                    ObjectMonster obj = pCaster as ObjectMonster;
                    obj.GetAnimation().Anim_Fidle(false);
                }
            }
            break;

            default:
                break;
            }
        }
示例#2
0
        public UI_Blood CreateBloodBar(ObjectMonster monster)
        {
            Transform tans = monster.GetAnimation().EventControl.Pre_Head_T_EffectPoint;

            GameObject      barObj   = null;
            MonsterTemplate template = (MonsterTemplate)DataTemplate.GetInstance().m_MonsterTable.getTableData(monster.GetTableID());

            if (template.getMonstertype() == 1)
            {
                barObj = Instantiate(UI_FightControler.Inst.monsterBloodPre) as GameObject;
            }

            else
            {
                barObj = Instantiate(UI_FightControler.Inst.bossBloodBar) as GameObject;
            }
            barObj.transform.SetParent(transform, false);

            UI_Blood mBlood = barObj.AddComponent <UI_Blood>();

            mBlood.SetPosition(tans.position);
            barObj.transform.localScale = new Vector3(1, 1, 1);
            bloodInfo.Add(mBlood);
            mBlood.isHero = false;
            if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter)
            {
                int CurRound = ObjectSelf.GetInstance().LimitFightMgr.m_RoundNum;
                UltimatetrialmonsterTemplate row = (UltimatetrialmonsterTemplate)DataTemplate.GetInstance().m_UltimatetrialmonsterTable.getTableData(CurRound);
                int nLevel = template.getMonsterlevel() + row.getAdditionalLevel();
                mBlood.setHeroLevel(nLevel);
            }
            else
            {
                mBlood.setHeroLevel(template.getMonsterlevel());
            }
            mBlood.setHeadPosition(tans);
            mBlood.uid.Copy(monster.GetGuid());

            return(mBlood);
        }