Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (HP > 0)
     {
         Life += LifePerFrame;
         Vector3 targetPos = Target.position;
         transform.rotation  = Quaternion.LookRotation(Vector3.forward, targetPos - transform.position);
         transform.position += transform.up * Speed * Time.deltaTime;
         if (Vector3.Distance(targetPos, transform.position) <= 1.8f)
         {
             GetNextWaypoint();
         }
     }
     else
     {
         Debug.Log(this.gameObject.name + " died. 100 score added.");
         ScoreKeeper.AddScore(100);
         Destroy(this.gameObject);
     }
 }
Beispiel #2
0
 public void GetPoint()
 {
     scorekeeper.AddScore(Player);
 }