Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        if (currentHealth <= 0)
        {
            player.enemyCount++;
            player.SendMessage("AddExp", GivenExp);
            player.SendMessage("AddGold", GivenGold);
            Destroy(gameObject);
        }

        if (Time.time >= timesStamp && isOnGround)
        {
            animator.SetTrigger("isAttacking");
            timesStamp = Time.time + attackTime;
        }
    }