예제 #1
0
 /// <summary>
 /// Checks the idle mode
 /// </summary>
 private void CheckIdle()
 {
     m_Target = CheckForPrey();
     if (m_Target != null)
     {
         GarbargeCollectorMode = GarbargeCollectorMode.Hunt;
     }
     else
     {
         GarbargeCollectorMode = GarbargeCollectorMode.Idle;
     }
 }
예제 #2
0
 /// <summary>
 /// Checks the Hunt mode
 /// </summary>
 private void CheckHunt()
 {
     if (m_Target != null)
     {
         float collectdistance = EnitiyManager.instance.GarbargeCollectorSettings.CollectDistance;
         float distance        = Vector3.Distance(transform.position, m_Target.transform.position);
         if (distance <= collectdistance)
         {
             IDataBrains dataBrains = m_Target.GetComponent <IDataBrains>();
             if (dataBrains != null)
             {
                 dataBrains.Collect();
                 GarbargeCollectorMode = GarbargeCollectorMode.Idle;
             }
         }
     }
 }