Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (Time.time > Albinos.GetAllow_action() && Albinos.GetTarget() != null)
     {
         float Distance = Vector3.Distance(Albinos.transform.position, Albinos.GetTarget().transform.position);
         if (Albinos.GetFight() && Distance <= Albinos.GetFightingRange())
         {
             Albinos.StartCoroutine("fighting");
         }
         else
         {
             Vector3 Targetposition = new Vector3(Albinos.GetTarget().transform.position.x, transform.position.y, Albinos.GetTarget().transform.position.z);
             transform.LookAt(Targetposition);
         }
     }
     if (Albinos.GetTarget() != null && Albinos.GetAllow_action() - Time.time <= 3)
     {
         Animator animationPlayer = Albinos.GetTarget().GetComponent <Animator>();
         if (animationPlayer.GetBool("Dead"))
         {
             animationPlayer.SetBool("Dead", false);
         }
     }
 }
Пример #2
0
 // Update is called once per frame
 void Update()
 {
     if (Time.time > Albinos.GetAllow_action() && Albinos.GetTarget() != null)
     {
         float Distance = Vector3.Distance(Albinos.transform.position, Albinos.GetTarget().transform.position);
         if (Albinos.GetFight() && Distance <= Albinos.GetFightingRange())
         {
             Albinos.StartCoroutine("fighting");
         }
         else
         {
             Vector3 Targetposition = new Vector3(Albinos.GetTarget().transform.position.x, transform.position.y, Albinos.GetTarget().transform.position.z);
             transform.LookAt(Targetposition);
         }
     }
 }