예제 #1
0
        // DLC specific functions

        public static int PilotWithTrait(string traitId)
        {
            int count = 0;

            foreach (MinionResume resume in Components.MinionResumes)
            {
                if (resume.HasMasteredSkill("RocketPiloting1"))
                {
                    Klei.AI.Traits traits = resume.gameObject.GetComponent <Klei.AI.Traits>();
                    if (traits != null)
                    {
                        if (traits.HasTrait(traitId))
                        {
                            count++;
                        }
                    }
                }
            }
            return(count);
        }
예제 #2
0
 /// <summary>
 /// Updates the sensors only once a second, as opposed to every frame.
 /// </summary>
 private void RunUpdate()
 {
     if (id != null && !id.HasTag(GameTags.Dead))
     {
         // The order of sensors matters here
         if (pathSensor != null)
         {
             PathProberSensorUpdater.Update(pathSensor);
         }
         if (pickupSensor != null)
         {
             PickupableSensorUpdater.Update(pickupSensor);
         }
         if (edibleSensor != null)
         {
             ClosestEdibleSensorUpdater.Update(edibleSensor);
         }
         if (balloonSensor != null && traits.HasTrait("BalloonArtist"))
         {
             BalloonStandCellSensorUpdater.Update(balloonSensor);
         }
         if (idleSensor != null)
         {
             IdleCellSensorUpdater.Update(idleSensor);
         }
         if (mingleSensor != null)
         {
             MingleCellSensorUpdater.Update(mingleSensor);
         }
         if (safeSensor != null)
         {
             SafeCellSensorUpdater.Update(safeSensor);
         }
         if (toiletSensor != null)
         {
             ToiletSensorUpdater.Update(toiletSensor);
         }
         // AssignableReachabilitySensor and BreathableAreaSensor are pretty cheap
     }
 }