Ejemplo n.º 1
0
    private void Start()
    {
        forceText.color   = colorText;
        pvText.color      = colorText;
        vitesseText.color = colorText;

        monsterStats  = monsterEmpty.GetComponent <MonsterStats>();
        monsterSystem = monsterEmpty.GetComponent <MonsterSystem>();
    }
Ejemplo n.º 2
0
 public void Attacking()
 {
     if (nearMonster != null)
     {
         MonsterSystem otherMonster = nearMonster.GetComponent <MonsterSystem>();
         if (player != otherMonster.player)
         {
             chronoAttack += Time.deltaTime;
             if (chronoAttack >= delayAttack)
             {
                 Attack.Invoke();
                 Instantiate(hitParticle, nearMonster.transform.GetChild(2).position, nearMonster.transform.rotation);
                 otherMonster.life -= powerAttack;
                 chronoAttack       = 0;
             }
         }
     }
 }