Esempio n. 1
0
 public override void Update()
 {
     if (GalaxyVector3.Distance(transform.position, player.transform.position) < 2)
     {
         return;
     }
     GalaxyVector3.LerpOptimize(transform.position, player.transform.position, instance.Time.deltaTime * 0.7f);
 }
Esempio n. 2
0
 public override void Update()
 {
     timer += instance.Time.deltaTime;
     if (timer > randTime)
     {
         timer    = 0;
         randTime = GRand.NextInt(10, 25);
         target.x = GRand.NextInt(-80, 80);
         target.z = GRand.NextInt(-80, 80);
     }
     GalaxyVector3.LerpOptimize(transform.position, target, instance.Time.deltaTime * 0.04f);   // лерпим текущую позицию к целевой раз в кадр
 }