Ejemplo n.º 1
0
    public void GetHurt(float value)
    {
        if (invincible)
        {
            return;
        }
        //Debug.Log("getHurt");

        state      = State.hurt;
        invincible = true;
        effectAudio.SetAudio(1);
        //animator.SetTrigger("is_hurt");
        speedX = .0f;
        speedY = .0f;
        if (state == State.attack)//如果被打到時正在攻擊,被斷招
        {
            animator.SetBool("is_attack", false);
        }
        playerManager.SetHP(teamA, -value * 0.02f);

        //if (inFuntionTime == 0)
        //{
        //    L_JoyX = 0.0f;
        //    L_JoyY = 0.0f;
        //    K_JoyX = 0.0f;
        //    K_JoyY = 0.0f;
        //    TeamHp.ChangeHp(false, 0.05f);
        //    inFuntionTime++;

        //}
    }
Ejemplo n.º 2
0
 void ShootAndExplosion()
 {
     Explosion.SetActive(true);
     Explosion.transform.position = RightAim.transform.position;
     CanonAnimator.SetTrigger("Shoot");
     CanonScript.CanonPowderNum--;
     characterVoice.SetAudio(5);
     OutOfBullet();
 }
Ejemplo n.º 3
0
 public void Attack()
 {
     //animation_type = 0;
     if (weapon.ani_type < 0)  //空手
     {
         animation_type = 0;
         return;
     }
     if (inFuntionTime == 0)
     {
         if (weapon.ani_type == 0) //持近距離武器
         {
             animator.SetInteger("weapon_type", 0);
         }
         else if (weapon.ani_type == 1)//持遠距離武器
         {
             animator.SetInteger("weapon_type", 1);
             if (!p1charaType)
             {
                 p1moveAble = false;
             }
             else
             {
                 p2moveAble = false;
             }
         }
         else if (weapon.ani_type == 2) //放陷阱
         {
             animator.SetInteger("weapon_type", 2);
             if (!p1charaType)
             {
                 p1moveAble = false;
             }
             else
             {
                 p2moveAble = false;
             }
         }
         animator.SetBool("is_attack", true);
         EffectAudio.SetAudio(weapon.audio_source);
         inFuntionTime++;
     }
 }
Ejemplo n.º 4
0
 void Attack()
 {
     if (pickWeapon.holdWeapon.ani_type == 0) //持近距離武器
     {
         animator.SetInteger("weapon_type", 0);
     }
     else if (pickWeapon.holdWeapon.ani_type == 1)//持遠距離武器
     {
         animator.SetInteger("weapon_type", 1);
     }
     else if (pickWeapon.holdWeapon.ani_type == 2) //放陷阱
     {
         animator.SetInteger("weapon_type", 2);
     }
     animator.SetBool("is_attack", true);
     Debug.Log(effectAudio);
     effectAudio.SetAudio(pickWeapon.holdWeapon.audio_source);
 }