Exemplo n.º 1
0
    public void AttackCalculate()
    {
        if (m_CurEnemy == null)
        {
            return;
        }
        //Debug.Log("Attack" + m_CurEnemy.name);
        //m_CurEnemy.GetComponent<MonsterState>().ShowEffect();

        int attackPower = myParams.GetRandomAttack();

        curEnemyParams.SetEnemyAttack(attackPower);
        // int attackPower = myParams.GetRandomAttack();


        //Collider[] hitColliders = Physics.OverlapSphere(transform.position, attackDistance, 1 << 10);
        //int num = hitColliders.Length;
        //for (int i = 0; i < num; i++)
        //{
        //    Debug.Log(hitColliders[i].name + i + "감지됨");


        //    Vector3 direction = hitColliders[i].transform.position - transform.position;
        //    if (Vector3.Angle(direction, transform.forward) < 45f)
        //    {

        //        hitColliders[i].GetComponent<Creature>().SetEnemyAttack(attackPower);
        //    }

        //}
    }
Exemplo n.º 2
0
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         int attackPower = myParams.GetRandomAttack();
         enemyParams.SetEnemyAttack(attackPower);
     }
 }
Exemplo n.º 3
0
    public void AttackCal()                           //공격 이벤트 함수.
    {
        int attackPower = myParams.GetRandomAttack(); //공격력 계산.

        monParams.SetEnemyAttack(attackPower);        //공격력을 몬스터 전달.
    }