Esempio n. 1
0
 void Update()
 {
     if (myHealth.getIsDead() == false)
     {
         if (timer < Time.time)
         {
             timer = Time.time + myAttributes.fireRate;
             Shoot();
         }
     }
 }
    void Update()
    {
        // set the name here, because sometimes start methods run in a wrong order and turns name empty.
        if (myText.text.Equals(""))
        {
            myText.text = GetComponent <attributes>().fullName.ToUpper();
        }

        if (myHealth.getIsDead())
        {
            Destroy(NamePlateInst.gameObject);
            this.enabled = false;
        }
        NamePlateInst.transform.position = Camera.main.WorldToScreenPoint(transform.position + totalOffset);
    }
Esempio n. 3
0
    void Update()
    {
        if (playerGo != null)
        {
            if (myHealth.getIsDead() == false)
            {
                RotateTowardsPlayer();
                MoveTowardsPlayerImpulse();
            }
        }

        if (GameSettings.enemiesWrapAroundScreen)
        {
            wrapScreen();
        }
    }
 void Update()
 {
     if (myHealth != null)
     {
         if (myHealth.getIsDead() == false)
         {
             shadowGo.transform.position = transform.position + offset;
             shadowGo.transform.rotation = transform.rotation;
         }
         else
         {
             Destroy(shadowGo);
             this.enabled = false;
         }
     }
     else
     {
         shadowGo.transform.position = transform.position + offset;
         shadowGo.transform.rotation = transform.rotation;
     }
 }