Example #1
0
 public PositionMonitorEntry(int x, int y, PositionMonitorLayer layer, GameObject obj, PositionMonitor monitor)
 {
     m_x       = x;
     m_y       = y;
     m_layer   = layer;
     m_object  = obj;
     m_monitor = monitor;
     Singleton <CellChangeMonitor> .Instance.RegisterCellChangedHandler(m_object.transform, new System.Action(this.UpdatePosition), "AggroCritter.SetMaster");
 }
Example #2
0
 public PositionMonitor()
 {
     if ((UnityEngine.Object)PositionMonitor.m_instance == (UnityEngine.Object)null)
     {
         m_instance = this;
     }
     this.m_layers.Add(new PositionMonitorLayer((HashedString)"DW_Default", 0));
     this.m_nodes = new PositionMonitor.PositionMonitorNode[64, Grid.WidthInCells, Grid.HeightInCells];
 }
            internal static void Postfix(Game __instance)
            {
                // First disable entirely if not activated
                if (!DangerousWorldOptions.Instance.AggroCrittersOption)
                {
                    return;
                }

                //PUtil.LogDebug("Game pre PrefabInit");
                PositionMonitor monitor = __instance.FindOrAdd <PositionMonitor>();

                monitor.AddLayer("DW_Hatches");
                monitor.AddLayer("DW_Minions");
            }