Ejemplo n.º 1
0
    // Use this for initialization


    /// <summary>
    /// 主武器攻击方式
    /// </summary>

    /// <summary>
    /// sword——普攻
    /// </summary>
    public void PrimaryWeaponsAttack0()
    {
        if (dazzleInsist)
        {
            return;
        }

        if (anim.currentAnimName == AnimationName.swordAttack_0)
        {
            return;
        }
        anim.PlayAnim(AnimationName.swordAttack_0);
        StartCoroutine(SlashDely());
    }
 public void Death()
 {
     print(gameObject.name + "死亡方法");
     //播放死亡动画
     anim.PlayAnim(AnimationName.death);
     //销毁物体  对象池
 }
Ejemplo n.º 3
0
    public void Shift(GameObject go)
    {
        if (anim.currentAnimName == AnimationName.Motion)
        {
            anim.PlayAnim(AnimationName.shiftWeapon);

            ++number;
            if (number % 2 == 0)
            {
                IsSword(true);
            }
            else
            {
                IsSword(false);
            }
        }
        else
        {
            print("只有非战斗状态才能切换武器");
        }
    }
    public void MoblieMove(float x, float y)
    {
        if (Mathf.Abs(x) < 1 && Mathf.Abs(y) < 1)
        {
            //anim.PlayAnim(AnimationName.idle);
            FloatSetting(0, 0);
        }
        else
        {
            if (x > 1 && Mathf.Abs(x) > Mathf.Abs(y))
            {
                FloatSetting(1, 0);
            }

            //anim.PlayAnim(AnimationName.runRight);
            else if (x < -1 && Mathf.Abs(x) > Mathf.Abs(y))
            {
                FloatSetting(-1, 0);
            }

            //anim.PlayAnim(AnimationName.runLeft);
            else if (y > 1 && Mathf.Abs(y) > Mathf.Abs(x))
            {
                FloatSetting(0, 1);
            }

            //anim.PlayAnim(AnimationName.runForward);
            else if (y < -1 && Mathf.Abs(y) > Mathf.Abs(x))
            {
                //anim.PlayAnim(AnimationName.runBack);
                FloatSetting(0, -1);
            }
            anim.PlayAnim(AnimationName.Motion);
            transform.position = Vector3.Lerp(transform.position, transform.position + new Vector3(x, 0, y).normalized *state.moveSpeed, Time.deltaTime);
        }
    }
 public void RunEvent()
 {
     anim.PlayAnim(AnimationName.normal);
 }
 /// <summary>
 /// 玩家结束动画
 /// </summary>
 public void IdleEvent()
 {
     anim.PlayAnim(AnimationName.Motion);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 播放动画
 /// </summary>
 /// <param name="animName">动画名称</param>
 public void PlayAnimation(string animName)
 {
     anim.PlayAnim(animName);
 }
Ejemplo n.º 8
0
 public virtual void  Death()
 {
     //播放死亡动画
     anim.PlayAnim(AnimationName.death);
     //销毁物体  对象池
 }