コード例 #1
0
        public override bool ShouldSkip(Pawn pawn, bool forced = false)
        {
            List <Building> allBuildingsColonist = pawn.Map.listerBuildings.allBuildingsColonist;

            for (int i = 0; i < allBuildingsColonist.Count; i++)
            {
                Building building = allBuildingsColonist[i];
                if (building.def == ThingDef.Named("VPE_GasDrill"))
                {
                    CompGasTrader comp = building.GetComp <CompGasTrader>();
                    if ((comp == null || comp.GasOn) && building.Map.designationManager.DesignationOn(building, DesignationDefOf.Uninstall) == null)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
コード例 #2
0
 public override void PostSpawnSetup(bool respawningAfterLoad)
 {
     base.PostSpawnSetup(respawningAfterLoad);
     gasComp = parent.GetComp <CompGasTrader>();
 }
コード例 #3
0
        public override void SpawnSetup(Map map, bool respawningAfterLoad)
        {
            base.SpawnSetup(map, respawningAfterLoad);

            gasComp = GetComp <CompGasTrader>();
        }