Пример #1
0
 void SpawnNormal(int spawnnum)
 {
     for (int i = 0; i < spawnnum; i++)
     {
         normalscript = Instantiate(spawnman, new Vector2(effectorpos.x + 0.1f, effectorpos.y + Random.Range(-0.1f, 0.1f)), Quaternion.identity).GetComponent <normalai>();
         normalscript.Scared(true);
     }
 }
Пример #2
0
 public void Hurt(float damage)
 {
     if (!isdeath)
     {
         hp = Mathf.Max(0f, hp - damage);
         healthbarupdate();
         if (CompareTag("normal"))
         {
             if (damage >= 40)
             {
                 normalscript.Scared(true);
             }
         }
     }
 }