Exemple #1
0
 public override void SpawnSetup(Map map, bool respawningAfterLoad)
 {
     base.SpawnSetup(map, respawningAfterLoad);
     gasProps       = def.mote as MoteProperties_GasCloud;
     relativeZOrder = ++GlobalOffsetCounter % 80;
     if (gasProps == null)
     {
         throw new Exception("Missing required gas mote properties in " + def.defName);
     }
     interpolatedScale.value    = GetRandomGasScale();
     interpolatedRotation.value = GetRandomGasRotation();
     // uniformly distribute gas ticks to reduce per frame workload
     // wait for next tick to avoid registering while DistributedTickScheduler is mid-tick
     HugsLibController.Instance.TickDelayScheduler.ScheduleCallback(() =>
                                                                    HugsLibController.Instance.DistributedTicker.RegisterTickability(GasTick, gasProps.GastickInterval, this)
                                                                    , 1, this);
     PlayerAvoidanceGrids.AddAvoidanceSource(this, AvoidanceGridPathCost);
 }
Exemple #2
0
 public override void DeSpawn(DestroyMode mode = DestroyMode.Vanish)
 {
     PlayerAvoidanceGrids.RemoveAvoidanceSource(this);
     base.DeSpawn(mode);
 }
 public override void MapDiscarded(Map map)
 {
     PlayerAvoidanceGrids.DiscardMap(map);
 }
 public override void SceneLoaded(Scene scene)
 {
     PlayerAvoidanceGrids.ClearAllMaps();
 }
Exemple #5
0
 public override void SpawnSetup(Map map, bool respawningAfterLoad)
 {
     base.SpawnSetup(map, respawningAfterLoad);
     HugsLibController.Instance.DistributedTicker.RegisterTickability(CustomTick, CustomDef.detectEveryTicks, this);
     PlayerAvoidanceGrids.AddAvoidanceSource(this, FriendlyPathCost);
 }