Exemplo n.º 1
0
 /// <summary>
 /// Checks Run from enemy
 /// </summary>
 private void RunFormEnemy()
 {
     if (m_Target != null)
     {
         float _distance = Vector3.Distance(transform.position, m_Target.transform.position);
         if (_distance > EnitiyManager.instance.DataCubeSettings.RunFromEnemyDistance)
         {
             ViriusStatus = ViriusMode.Idle;
         }
         UpdateDataCubeBehavoir();
     }
     else
     {
         ViriusBrain[] viriusBrains = Support.CheckForNearbyObjects <ViriusBrain>(transform.position, EnitiyManager.instance.DataCubeSettings.RunFromEnemyDistance);
         if (viriusBrains.Length > 0)
         {
             m_Target = viriusBrains[0].gameObject;
             UpdateDataCubeBehavoir();
         }
     }
 }