Beispiel #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     kadrihz++;
     if (nav.remainingDistance < 17f)
     {
         if (kadrihz >= promezhutok)  //!nav.pathPending && nav.remainingDistance < 0.5f ||
         {
             GoToNextPoint();
             if (!zombie.zombRun)
             {
                 zombie.IsRunning(true);
             }
             promezhutok = kadrihz + 15;
             attackCooldown--;
             if (TargetPoint != null & nav.remainingDistance > 0.6f & attackCooldown <= 0 & nav.remainingDistance < 2.3f)
             {
                 zombie.AttackPlayer();
                 attackCooldown = 4;
             }
         }
     }
     if (kadrihz >= 20000) //Обнуляем счётчик
     {
         kadrihz        = 0;
         promezhutok    = 20;
         attackCooldown = 0;
     }
 }