예제 #1
0
 // Update is called once per frame
 void Update()
 {
     HPbar.fillAmount = dragon.life / startHP;
     if (isDead())
     {
         player.monsterKills++;
         content.CheckProgress();
         dragon.Death = true;
         dragon.DisableAnimal();
         Destroy(this.gameObject);
         gameSystem.Save();
         //StartCoroutine(WaitandDestroy());
     }
     else
     {
         if (player != null)
         {
             DifficultyAdjustment();
             FollowAndAttack(player.gameObject);
             if (TargetDead(player.gameObject))
             {
                 StopAttack();
                 this.GetComponent <LookAt>().enabled = false;
                 if (spawn == null)
                 {
                     return;
                 }
                 follow.target = spawn;
                 Reposition(3);
             }
         }
         if (npc != null)
         {
             DifficultyAdjustment();
             FollowAndAttack(npc);
             if (TargetDead(npc))
             {
                 StopAttack();
                 this.GetComponent <LookAt>().enabled = false;
                 if (spawn == null)
                 {
                     return;
                 }
                 follow.target = spawn;
             }
         }
     }
 }