Esempio n. 1
0
 public void Attack()
 {
     if (currentATB >= 1)
     {
         enemyBattle.TakeDamage(5);
         currentATB -= 1;
     }
 }
Esempio n. 2
0
    void checkClickedTarget(RaycastResult result)
    {
        if (result.gameObject.tag == "Enemy")
        {
            //To do : damage enemy here
            EnemyBattle enemyBattle = result.gameObject.GetComponent <EnemyBattle>();
            enemyBattle.TakeDamage(playerStats.GetDmg());

            playerBattle.GetActionBar().value = 0.0f;
            if (animator != null)
            {
                animator.SetTrigger("Attack");
                Debug.Log("AnimAtk");
            }

            TargetSelection = false;
            AttackList.SetActive(false);
            gameObject.SetActive(false);
            playerBattle.SetCharSelect(false);
        }
        else if (result.gameObject.layer == 8)//Character Layer
        {
            AttackList.SetActive(false);
            TargetSelection = false;
        }
    }