Exemple #1
0
 void FightStateUpdate()
 {
     if (m_Target == null)
     {
         m_Target = FindTargetInRadius();
     }
     else
     {
         bool moveToTarget = false;
     }
 }
Exemple #2
0
 void FightStateUpdate()
 {
     if (m_Target == null)
     {
         m_Target = FindTargetInRadius();
     }
     else
     {
         bool moveToTarget = false;
         TryAttack(out moveToTarget);
         if (moveToTarget)
         {
             MoveToTarget();
         }
     }
 }
Exemple #3
0
    public SkillTest FindTargetInRadius()
    {
        Collider[] colliders = Physics.OverlapSphere(transform.position, 100, 1 << LayerMask.NameToLayer("Warrior"));

        foreach (Collider collider in colliders)
        {
            SkillTest unit = collider.gameObject.GetComponent <SkillTest>();
            if (unit == null)
            {
                continue;
            }
            if (unit == this)
            {
                continue;
            }
            return(unit);
        }
        return(null);
    }
 private void Awake()
 {
     SkillTest.ins = this;
     UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
 }