Ejemplo n.º 1
0
 void FightStateUpdate()
 {
     if (m_Target == null)
     {
         m_Target = FindTargetInRadius();
     }
     else
     {
         bool moveToTarget = false;
     }
 }
Ejemplo n.º 2
0
 void FightStateUpdate()
 {
     if (m_Target == null)
     {
         m_Target = FindTargetInRadius();
     }
     else
     {
         bool moveToTarget = false;
         TryAttack(out moveToTarget);
         if (moveToTarget)
         {
             MoveToTarget();
         }
     }
 }
Ejemplo n.º 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);
    }
Ejemplo n.º 4
0
 private void Awake()
 {
     SkillTest.ins = this;
     UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
 }