public void Sim200ms(float dt)
        {
            try
            {
                Schedule s = ScheduleManager.Instance.GetSchedules()[scheduleIndex];
                int      currentScheduleBlock = Schedule.GetBlockIdx();

                float meterPercent = (float)(currentScheduleBlock) / 24f;
                meter.SetPositionPercent(meterPercent);

                ScheduleBlock b = s.GetBlock(currentScheduleBlock);
                string        currentScheduleGroup = b.GroupId;

                meter.SetSymbolTint("face", GetBlockColor(b));

                string selectedScheduleGroup = Db.Get().ScheduleGroups.allGroups[blockTypeIndex].Id;

                bool state = (string.Equals(currentScheduleGroup, selectedScheduleGroup));
                SetState(state);
            }
            catch (Exception ex)
            {
                Debug.Log($"Failed to update Schedule Sensor: {ex.ToString()}");
                SetState(false);
            }
        }
Beispiel #2
0
    protected override void OnStartWork(Worker worker)
    {
        base.OnStartWork(worker);
        Pickupable.PickupableStartWorkInfo pickupableStartWorkInfo = (Pickupable.PickupableStartWorkInfo)worker.startWorkInfo;
        float   amount  = pickupableStartWorkInfo.amount;
        Element element = pickupableStartWorkInfo.originalPickupable.GetComponent <PrimaryElement>().Element;

        session = new WorkSession(Grid.PosToCell(this), element.id, pickupableStartWorkInfo.originalPickupable.GetComponent <SubstanceChunk>(), amount, base.gameObject);
        meter.SetPositionPercent(0f);
        meter.SetSymbolTint(new KAnimHashedString("meter_target"), element.substance.colour);
    }