Exemplo n.º 1
0
    public DiseaseContainer(GameObject go, byte elemIdx)
    {
        this.elemIdx = elemIdx;
        isContainer  = (go.GetComponent <IUserControlledCapacity>() != null);
        Conduit component = go.GetComponent <Conduit>();

        if ((Object)component != (Object)null)
        {
            conduitType = component.type;
        }
        else
        {
            conduitType = ConduitType.None;
        }
        controller            = go.GetComponent <KBatchedAnimController>();
        overpopulationCount   = 1;
        instanceGrowthRate    = 1f;
        accumulatedError      = 0f;
        visualDiseaseProvider = null;
        autoDisinfectable     = go.GetComponent <AutoDisinfectable>();
        if ((Object)autoDisinfectable != (Object)null)
        {
            AutoDisinfectableManager.Instance.AddAutoDisinfectable(autoDisinfectable);
        }
    }
Exemplo n.º 2
0
            public static bool Prefix(AutoDisinfectable __instance)
            {
                var primaryElement = __instance.GetComponent <PrimaryElement>();

                if (primaryElement.DiseaseIdx != RadiationGerms.Index)
                {
                    return(true);
                }

                return(false);
            }
Exemplo n.º 3
0
    protected override void OnCleanUp(HandleVector <int> .Handle h)
    {
        DiseaseContainer  payload           = GetPayload(h);
        AutoDisinfectable autoDisinfectable = payload.autoDisinfectable;

        if ((UnityEngine.Object)autoDisinfectable != (UnityEngine.Object)null)
        {
            AutoDisinfectableManager.Instance.RemoveAutoDisinfectable(autoDisinfectable);
        }
        base.OnCleanUp(h);
    }
Exemplo n.º 4
0
            public static bool Prefix(AutoDisinfectable __instance, PrimaryElement ___primaryElement, ref Chore ___chore)
            {
                if (KMonoBehaviour.isLoadingScene)
                {
                    return(true);
                }
                if (___primaryElement.DiseaseIdx != RadiationGerms.Index)
                {
                    return(true);
                }

                if (___chore != null)
                {
                    ___chore.Cancel("AutoDisinfect Radiation");
                    ___chore = null;
                }

                return(false);
            }
 public void RemoveAutoDisinfectable(AutoDisinfectable auto_disinfectable)
 {
     auto_disinfectable.CancelChore();
     autoDisinfectables.Remove(auto_disinfectable);
 }
 public void AddAutoDisinfectable(AutoDisinfectable auto_disinfectable)
 {
     autoDisinfectables.Add(auto_disinfectable);
 }