コード例 #1
0
        protected override void OnSpawn()
        {
            base.OnSpawn();
            this.animController = base.GetComponent <KBatchedAnimController>();
            base.OnToggle      += new Action <bool>(this.OnSwitchToggled);
            this.UpdateVisualState(true);
            this.wasOn = this.switchedOn;

            // subscribe to add/remove pickupables on the cell in question
            int cell = this.NaturalBuildingCell();

            this.pickupablesChangedEntry = GameScenePartitioner.Instance.Add("ItemTemperatureSensor.PickupablesChanged", base.gameObject, cell, GameScenePartitioner.Instance.pickupablesChangedLayer, new Action <object>(this.OnPickupablesChanged));

            this.Update();

            // load refresh interval from config file
            this.refreshInterval = MoreTemperatureSensorsConfig.Config.GetItemInterval;

            this.itemCountThreshold = MoreTemperatureSensorsConfig.Config.ItemSensorItemCountFastThreshold;
            if (this.itemCountThreshold < 0)
            {
                this.itemCountThreshold = 0;
            }

            // Apply color
            this.OnOverlayChange("");
            OverlayChangeController.Add(this);
        }
コード例 #2
0
        protected override void OnSpawn()
        {
            base.OnSpawn();

            // Apply color
            this.OnOverlayChange("");
            OverlayChangeController.Add(this);
        }
コード例 #3
0
        protected override void OnSpawn()
        {
            base.OnSpawn();

            this.cell = base.GetComponent <Building>().GetCellWithOffset(new CellOffset(0, -1));

            this.SetTemperature();

            // Apply color
            this.OnOverlayChange("");
            OverlayChangeController.Add(this);
        }
コード例 #4
0
        protected override void OnSpawn()
        {
            this.cell = base.GetComponent <Building>().GetCellWithOffset(new CellOffset(0, 0));
            base.OnSpawn();

            base.OnToggle += new Action <bool>(this.OnSwitchToggled);

            this.updateInterval = MoreTemperatureSensorsConfig.Config.GetBatteryInterval;

            // Apply color
            this.OnOverlayChange("");
            OverlayChangeController.Add(this);
        }
コード例 #5
0
        protected override void OnSpawn()
        {
            this.max = this.conduitType == ConduitType.Gas ? 1000f : 10000f;

            base.OnSpawn();
            OverlayChangeController.Add(this);

            // Update currentValue to avoid all displays from showing 0 g on load.
            // No functional change. It's purely a display issue.
            this.ConduitUpdate(-10);

            // Apply color
            this.OnOverlayChange("");
        }
コード例 #6
0
        protected override void OnSpawn()
        {
            base.OnSpawn();
            this.animController = base.GetComponent <KBatchedAnimController>();
            base.OnToggle      += new Action <bool>(this.OnSwitchToggled);
            this.UpdateLogicCircuit();
            this.UpdateVisualState(true);
            this.wasOn = this.switchedOn;
            Game.Instance.solidConduitFlow.AddConduitUpdater(new Action <float>(this.ConduitUpdate), ConduitFlowPriority.Default);

            // Apply color if color if a color is set
            //
            if (color.a != 0)
            {
                OverlayChangeController.Add(this);
                this.OnOverlayChange("");
            }
        }
コード例 #7
0
        protected override void OnSpawn()
        {
            base.OnSpawn();

            // subscribe to add/remove pickupables on the cell in question
            int cell = this.NaturalBuildingCell();

            this.pickupablesChangedEntry = GameScenePartitioner.Instance.Add("ItemTemperatureSensor.PickupablesChanged", base.gameObject, cell, GameScenePartitioner.Instance.pickupablesChangedLayer, new Action <object>(this.OnPickupablesChanged));

            this.Update();

            // load refresh interval from config file
            this.refreshInterval = MoreTemperatureSensorsConfig.Config.ItemSensorUpdateIntervalSeconds;
            if (this.refreshInterval < 0.15f)
            {
                this.refreshInterval = 0.15f;
            }

            // Apply color
            this.OnOverlayChange("");
            OverlayChangeController.Add(this);
        }