예제 #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();
            }
        }
    }