public void OnArmyWorldUnitCreated(WorldUnit worldUnit) { WorldPawn worldMonsterPawn = this.GetWorldMonsterPawn(worldUnit); if (worldMonsterPawn != null) { worldMonsterPawn.WorldPawnFinalWorldOrientationChanged += this.WorldPawn_OnFinalWorldOrientationChanged; } }
public void OnArmyWorldUnitBeginAutoKillDelayPeriod(WorldUnit worldUnit) { WorldPawn worldMonsterPawn = this.GetWorldMonsterPawn(worldUnit); if (worldMonsterPawn != null) { worldMonsterPawn.WorldPawnFinalWorldOrientationChanged -= this.WorldPawn_OnFinalWorldOrientationChanged; } }
private WorldPawn GetWorldMonsterPawn(WorldUnit worldUnit) { WorldPawn result = null; for (int i = 0; i < worldUnit.WorldPawns.Length; i++) { WorldPawn worldPawn = worldUnit.WorldPawns[i]; if (worldPawn != null && worldPawn.Unit.UnitDesign.Tags.Contains(Kaiju.MonsterUnitTag)) { result = worldPawn; break; } } return(result); }