Ejemplo n.º 1
0
    /// <summary>
    /// 死亡的前端表现.
    /// </summary>
    private void createDeathClientBehaviour(ImpactDamageType damageType, AttackerAttr killerAttr)
    {
        // 材质死亡(特效).
        ErrorHandler.Parse(
            mOwner.AddMaterialBehaviour(MaterialBehaviourDef.OnMaterialDie, damageType, killerAttr.EffectStartDirection),
            "failed to add death material effect"
            );

        // 死亡动作.
        MecanimStateController stateControl = mOwner.GetStateController();
        AnimatorProperty       animSet      = stateControl.AnimSet;

        if (animSet != null && !string.IsNullOrEmpty(mOwner.GetDeathAnimation()))        //animSet.NumOfDie > 0)
        {
            AnimActionDeath death = AnimActionFactory.Create(AnimActionFactory.E_Type.Death) as AnimActionDeath;
            death.dieAnim = mOwner.GetDeathAnimation();
            if (stateControl.AnimSet != null)
            {
                mDieAnimationHashCode = stateControl.AnimSet.GetStateHash(death.dieAnim);
            }
            stateControl.DoAction(death);
        }


        //mOwner.SetDeathMaterial("dssipate");
        //mOwner.SetDeathMaterial("burn_out");
        // 死亡声音.
        if (mOwner.GetDeadSound() != -1)
        {
            SoundManager.Instance.Play(mOwner.GetDeadSound());
        }
    }
Ejemplo n.º 2
0
    private bool PlayAni(ObjectBase obj, ArrayList param)
    {
        if (param == null || param.Count < 2)
        {
            return(false);
        }

        Player player = obj as Player;

        if (player == null)
        {
            return(false);
        }

        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;

        if (System.Convert.ToInt32(param[0]) == 0)
        {
            action.AnimName = "Base Layer." + (param[1] as string);
        }
        else
        {
            action.AnimName = "Base Layer." + player.CombineAnimname("%" + param[1] as string);
        }

        player.GetStateController().DoAction(action);

        WindowManager.Instance.CloseUI("chat");

        return(true);
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 播放动画.
    /// </summary>
    public static void PlayAnimation(BattleUnit owner, string aniName, bool loop = false, ClientBehaviourIdContainer cont = null)
    {
        if (cont != null && cont.roleAnimationHashCode != 0)
        {
            owner.GetStateController().FinishCurrentState(cont.roleAnimationHashCode);
            cont.roleAnimationHashCode = 0;
        }

        if (!string.IsNullOrEmpty(aniName))
        {
            string animationName = owner.CombineAnimname(aniName);
            int    hashCode      = 0;
            if (owner.GetStateController().AnimSet != null)
            {
                hashCode = owner.GetStateController().AnimSet.GetStateHash(animationName);
            }

            if (hashCode != 0)
            {
                AnimActionUseSkill skillAction = AnimActionFactory.Create(AnimActionFactory.E_Type.UseSkill) as AnimActionUseSkill;
                skillAction.AnimName = animationName;

                skillAction.loop = loop;
                owner.GetStateController().DoAction(skillAction);

                // 动作无论循环与否, 都保存ID.
                if (cont != null)
                {
                    cont.roleAnimationHashCode = hashCode;
                }
            }
        }
    }
Ejemplo n.º 4
0
    static public void PlayAni(uint objId, string aniName)
    {
        BaseScene scn = SceneManager.Instance.GetCurScene();

        if (scn == null)
        {
            return;
        }

        ObjectBase obj = scn.FindObject(objId);

        if (obj == null)
        {
            return;
        }

        VisualObject vObj = obj as VisualObject;

        if (vObj == null)
        {
            return;
        }

        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;

        action.AnimName = aniName;

        vObj.GetStateController().DoAction(action);
        return;
    }
Ejemplo n.º 5
0
    public void PlayLeisureAnimation()
    {
        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;

        action.AnimName = CombineAnimname("%xiuxian");
        GetStateController().DoAction(action);

        //GetStateController().DoAction(AnimActionFactory.E_Type.PlayIdleAnim);
    }
    public void DoAction(AnimActionFactory.E_Type type, Statelayer layer = Statelayer.Normal)
    {
        if (!mHasSetup)
        {
            return;
        }
        AnimAction action = AnimActionFactory.Create(type);

        DoAction(action, layer);
    }
Ejemplo n.º 7
0
    protected override void onDie(AttackerAttr killerAttr, ImpactDamageType impactDamageType)
    {
        AnimActionDeath death = AnimActionFactory.Create(AnimActionFactory.E_Type.Death) as AnimActionDeath;

        death.dieAnim = "Base Layer." + mRes.die_ani;
        GetStateController().DoAction(death);

        DisplayDieEffect();

        //DestroyBornEffect();

        base.onDie(killerAttr, impactDamageType);
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 播放武器动画.
    /// </summary>
    public static void PlayWeaponAnimation(BattleUnit owner, string aniName, bool loop = false, ClientBehaviourIdContainer cont = null)
    {
        if (!string.IsNullOrEmpty(aniName))
        {
            AnimActionUseSkill skillAction = AnimActionFactory.Create(AnimActionFactory.E_Type.UseSkill) as AnimActionUseSkill;
            skillAction.loop = loop;
            owner.PlayWeaponAnim(AnimationNameDef.WeaponPrefix + aniName);

            if (cont != null)
            {
                cont.weaponAnimation = 1;
            }
        }
    }
Ejemplo n.º 9
0
    public void btnPlayAnimation()
    {
        //AnimAction action = AnimActionFactory.Create(AnimActionFactory.E_Type.Idle);
        //player.GetAnimFSM().DoAction(action);


        //AnimActionPlayAnim animAction = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;
        //animAction.AnimName = "Base Layer.die01";
        //player.GetAnimFSM().DoAction(animAction);

        AnimActionUseSkill animAction = AnimActionFactory.Create(AnimActionFactory.E_Type.UseSkill) as AnimActionUseSkill;

        animAction.AnimName = "pingchi.huandan";
        player.GetStateController().DoAction(animAction);
        //player.GetAnimFSM().DoAction(animAction);
    }
Ejemplo n.º 10
0
    override public bool Init(BaseSceneInitParam param)
    {
        mSubRes = DataManager.SceneTable[param.res_id] as Scene_QualifyingSceneTableItem;
        if (mSubRes == null)
        {
            return(false);
        }

        if (!base.Init(param))
        {
            return(false);
        }

        mResult             = -1;
        mAnimParam          = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;
        mAnimParam.AnimName = "Base Layer.huanhu";

        return(true);
    }
Ejemplo n.º 11
0
    private void OnBegin()
    {
        AnimActionUseSkill skillAction = AnimActionFactory.Create(AnimActionFactory.E_Type.UseSkill) as AnimActionUseSkill;

        skillAction.AnimName = mOwner.CombineAnimname("%huandan");
        if (mOwner.GetStateController().AnimSet != null)
        {
            mReloadAnimationHashCode = mOwner.GetStateController().AnimSet.GetStateHash(skillAction.AnimName);
        }
        mOwner.GetStateController().DoAction(skillAction);

        mOwner.PlayWeaponAnim(AnimationNameDef.WeaponDefault);
        if (mOwner is Player || ((mOwner is Ghost) && (mOwner as Ghost).IsMainPlayer()))
        {
            ReloadEvent evt = new ReloadEvent(ReloadEvent.RELOAD_EVENT);
            evt.reload_time = mReloadTime;
            EventSystem.Instance.PushEvent(evt);
        }
    }
Ejemplo n.º 12
0
    private void PlayBornAnimation()
    {
        if (mRes == null)
        {
            return;
        }

        if (string.IsNullOrEmpty(mRes.bornAni) || mRes.bornAniTime == uint.MaxValue)
        {
            return;
        }

        AnimActionPlayAnim action = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;


        action.AnimName = CombineAnimname("%" + mRes.bornAni);

        GetStateController().DoAction(action);

        mBornAniTime = (int)mRes.bornAniTime;
    }
Ejemplo n.º 13
0
    override public bool Init(BaseSceneInitParam param)
    {
        mSubRes = DataManager.SceneTable[param.res_id] as Scene_TDSceneTableItem;
        if (mSubRes == null)
        {
            return(false);
        }

        if (!base.Init(param))
        {
            return(false);
        }

        mLife             = GameConfig.TDLifeCount;
        mBalanceComponent = new TDBalanceComponent(this);

        mAnimParam          = AnimActionFactory.Create(AnimActionFactory.E_Type.PlayAnim) as AnimActionPlayAnim;
        mAnimParam.AnimName = "Base Layer.huanhu";

        return(true);
    }