コード例 #1
0
        //战斗状态
        void ProcessCombatAnimState()
        {
            if (ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER)
            {
                // 玩家装备了坐骑
                Obj_MainPlayer MainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

                if (MainPlayer.IsDie() == false && MainPlayer.GetEquipMountID() > 0 && MainPlayer.MountObj)
                {
                    m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.AttackStand);
                    MainPlayer.MountObj.PlayMountPlayerAnima(CharacterDefine.MountAction.STAND, MainPlayer);
                }
                else
                {
                    m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.AttackStand));
                }
            }
        }
コード例 #2
0
        //行走状态处理
        void ProcessWalkAnimState()
        {
            //移动时 还在播受击动作或者击倒动作 则停止播放
            if (AnimLogic != null &&
                AnimLogic.CurAnimData != null)
            {
                if (AnimLogic.CurAnimData.AnimID == (int)CharacterDefine.CharacterAnimId.Hit ||
                    AnimLogic.CurAnimData.AnimID == (int)CharacterDefine.CharacterAnimId.Knockback_01)
                {
                    m_AnimLogic.Stop();
                }
                if (IsLightState == false && AnimLogic.CurAnimData.AnimID == (int)CharacterDefine.CharacterAnimId.LIGHTSKILLEND)
                {
                    m_AnimLogic.Stop();
                }
            }
            if (ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER)
            {
                // 玩家装备了坐骑
                Obj_MainPlayer MainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

                if (MainPlayer.IsDie() == false && MainPlayer.GetEquipMountID() > 0 && MainPlayer.MountObj)
                {
                    m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.Walk);
                    CharacterDefine.MountAction nMountPlayerAniID = CharacterDefine.MountAction.RUN;
                    if (MainPlayer.GetEquipMountID() == GlobeVar.MOUNT_TIANLONG_ID)
                    {
                        nMountPlayerAniID = CharacterDefine.MountAction.STAND;
                    }
                    MainPlayer.MountObj.PlayMountPlayerAnima(nMountPlayerAniID, MainPlayer);
                }
                else
                {
                    m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.Walk));
                }
            }
            else
            {
                if (ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                {
                    Obj_OtherPlayer OtherPlayer = this.GetComponent <Obj_OtherPlayer>();
                    if (OtherPlayer && OtherPlayer.IsDie() == false && OtherPlayer.MountID > 0 && OtherPlayer.MountObj)
                    {
                        m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.Walk);
                        CharacterDefine.MountAction nMountPlayerAniID = CharacterDefine.MountAction.RUN;
                        if (OtherPlayer.MountID == GlobeVar.MOUNT_TIANLONG_ID)
                        {
                            nMountPlayerAniID = CharacterDefine.MountAction.STAND;
                        }
                        OtherPlayer.MountObj.PlayMountPlayerAnima(nMountPlayerAniID, OtherPlayer);
                    }
                    else
                    {
                        m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.Walk));
                    }
                }
                else
                {
                    m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.Walk));
                }
            }
            if (ObjEffectController != null)
            {
                ObjEffectController.OnMove();
            }
        }
コード例 #3
0
        //待机状态处理
        void ProcessIdleAnimState(bool playEffectImmediately = true)
        {
            if (ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_MAIN_PLAYER)
            {
                // 玩家装备了坐骑
                Obj_MainPlayer MainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

                if (MainPlayer.IsDie() == false && MainPlayer.GetEquipMountID() > 0 && MainPlayer.MountObj)
                {
                    m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.Stand);
                    MainPlayer.MountObj.PlayMountPlayerAnima(CharacterDefine.MountAction.STAND, MainPlayer);
                }
                else
                {
                    if (MainPlayer.InDizzy)
                    {
                        m_AnimLogic.Stop();
                        m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.DizzyId);
                        return;
                    }

                    if (MainPlayer.InCombat)
                    {
                        m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.AttackStand);
                    }
                    else
                    {
                        m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.Stand);
                    }
                }
            }
            else
            {
                if (ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                {
                    Obj_OtherPlayer OtherPlayer = this as Obj_OtherPlayer;
                    if (OtherPlayer && OtherPlayer.IsDie() == false && OtherPlayer.MountID > 0 && OtherPlayer.MountObj)
                    {
                        m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.Stand);
                        OtherPlayer.MountObj.PlayMountPlayerAnima(CharacterDefine.MountAction.STAND, OtherPlayer);
                    }
                    else
                    {
                        if (OtherPlayer.InDizzy)
                        {
                            m_AnimLogic.Stop();
                            m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.DizzyId);
                            return;
                        }
                        m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.Stand));
                    }
                }
                else
                {
                    if (this.InDizzy)
                    {
                        m_AnimLogic.Stop();
                        m_AnimLogic.Play((int)CharacterDefine.CharacterAnimId.DizzyId);
                        return;
                    }
                    //如果是其他Obj,就需要根据DataID区分是否为战斗型的NPC
                    //非战斗NPC默认播放Stand动作
                    //战斗NPC播放AttackStand动作
                    Tab_RoleBaseAttr roleBaseTab = TableManager.GetRoleBaseAttrByID(BaseAttr.RoleBaseID, 0);
                    if (null != roleBaseTab && roleBaseTab.CombatNPC > 0)
                    {
                        //是战斗NPC,播放AttackStand
                        if (playEffectImmediately)
                        {
                            m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.AttackStand));
                        }
                    }
                    else
                    {
                        m_AnimLogic.Play((int)(CharacterDefine.CharacterAnimId.Stand));
                    }
                }
            }
            if (ObjEffectController != null)
            {
                ObjEffectController.OnIdle();
            }
        }