Ejemplo n.º 1
0
    /// <summary>
    /// Update is called once per frame
    /// </summary>
    void Update()
    {
        if (health > 0)
        {
            if (!animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_fall"))
            {
                currentstate.Execute();
            }
        }
        else if (health <= 0 && isDead == false)
        {
            animator.SetFloat("Damage", 90);
            isDead = true;
        }

        if (isDead == true)
        {
            dietimer += Time.deltaTime;
            if (dietimer >= 3)
            {
                Destroy(this.gameObject);
            }
        }

        //print(health);


        ClampInScreen();
    } // update end
Ejemplo n.º 2
0
 /// Update is called once per frame
 void Update()
 {
     if (!isDead)
     {
         if (!isTakingDamage)
         {
             currentState.Execute();
         }
         TurnToTarget();
     }
 }
Ejemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (!IsDead)
     {
         if (!TakingDamage)
         {
             currentState.Execute();
         }
         LookAtTarget();
     }
 }
 public void Update()
 {
     if (!IsDead)
     {
         if (!TakingDamage)
         {
             currentState.Execute();
         }
         LookAtTarget();
     }
     distanceToPlayer = Vector2.Distance(transform.position, player.transform.position);
 }
Ejemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        currentState.Execute();

        LookAtTarget();

        IsDead();

        if (Dead == true)
        {
            DeadTimer += Time.deltaTime;
            if (DeadTimer >= DeadCD)
            {
                Player CharacterScript = CharacterPlayer.GetComponent <Player> ();
                CharacterScript.kills += 1;
                Destroy(gameObject);
            }
        }
    }