Пример #1
0
    //void OnTriggerEnter2D(Collider2D other) {
    //	//Debug.Log ("Enemy OnTriggerEnter2D : " + other.name);
    //	if (other.tag == "PlayerArm") {
    //		AnimatorStateInfo stateInfo = playerAnim.GetCurrentAnimatorStateInfo(0);
    //		if (attackHash != stateInfo.fullPathHash) {
    //			attackHash = stateInfo.fullPathHash;
    //			enemyCtrl.ActionDamage ();
    //		}
    //	} else
    //	if (other.tag == "PlayerArmBullet") {
    //		Destroy (other.gameObject);
    //		enemyCtrl.ActionDamage ();
    //	}
    //}

    void OnTriggerEnter2D(Collider2D other)
    {
        //Debug.Log ("Enemy OnTriggerEnter2D : " + other.name);
        if (other.tag == "PlayerArm")
        {
            enemyCtrl.ActionDamage();
            playsound();
        }
        else
        if (other.tag == "PlayerArmBullet")
        {
            Destroy(other.gameObject);
            enemyCtrl.ActionDamage();
            playsound();
        }
    }
Пример #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "PlayerArm")
        {
            AnimatorStateInfo stateInfo = playerAnim.GetCurrentAnimatorStateInfo(0);

            if (attackHash != stateInfo.nameHash)
            {
                attackHash = stateInfo.nameHash;
                enemyCtrl.ActionDamage();
                Camera.main.GetComponent <CameraFollow>().AddCameraSize(-0.01f, -0.3f);
            }
        }
        else if (other.tag == "PlayerArmBullet")
        {
            Destroy(other.gameObject);
            enemyCtrl.ActionDamage();
        }
    }
Пример #3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     //Debug.Log ("Enemy OnTriggerEnter2D : " + other.name);
     if (other.tag == "PlayerArm")
     {
         AnimatorStateInfo stateInfo = playerAnim.GetCurrentAnimatorStateInfo(0);
         if (attackHash != stateInfo.nameHash)
         {
             attackHash = stateInfo.nameHash;
             enemyCtrl.ActionDamage();
         }
     }
     else
     if (other.tag == "PlayerArmBullet")
     {
         Destroy(other.gameObject);
         enemyCtrl.ActionDamage();
     }
 }
Пример #4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag == "PlayerArm")
     {
         AnimatorStateInfo stateInfo = playerAnim.GetCurrentAnimatorStateInfo(0);
         if (attackHash != stateInfo.fullPathHash)
         {
             attackHash = stateInfo.fullPathHash;
             enemyCtrl.ActionDamage();
             enemyCtrl.NockBack(playerCtrl.attackNockBackVector);
         }
     }
 }
Пример #5
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "PlayerArm")
        {
            AnimatorStateInfo stateInfo = playerAnim.GetCurrentAnimatorStateInfo(0);
            if (attackHash != stateInfo.fullPathHash)
            {
                attackHash = stateInfo.fullPathHash;
                enemyCtrl.ActionDamage();

                enemyCtrl.NockBack
                (
                    playerStatusManager.attackNockBackVector,
                    playerStatusManager.isSmash,
                    playerStatusManager.isLastAttack,
                    playerStatusManager.nockBackTimer
                );
                enemyCtrl.expGain = playerStatusManager.GetExp();
                playerStatusManager.GetSmash();
            }
        }
    }