Пример #1
0
    private void InitSliders()
    {
        PlayerConditionModule playerConditionModule = PlayerConditionModule.Get();

        this.m_Proteins.minValue  = 0f;
        this.m_Proteins.maxValue  = playerConditionModule.GetMaxNutritionProtein();
        this.m_Proteins.value     = playerConditionModule.GetNutritionProtein();
        this.m_Fat.minValue       = 0f;
        this.m_Fat.maxValue       = playerConditionModule.GetMaxNutritionFat();
        this.m_Fat.value          = playerConditionModule.GetNutritionFat();
        this.m_Carbo.minValue     = 0f;
        this.m_Carbo.maxValue     = playerConditionModule.GetMaxNutritionCarbo();
        this.m_Carbo.value        = playerConditionModule.GetNutritionCarbo();
        this.m_Hydration.minValue = 0f;
        this.m_Hydration.maxValue = playerConditionModule.GetMaxHydration();
        this.m_Hydration.value    = playerConditionModule.GetHydration();
        this.m_HP.minValue        = 1f;
        this.m_HP.maxValue        = playerConditionModule.GetMaxHP();
        this.m_HP.value           = playerConditionModule.GetHP();
        this.m_Energy.minValue    = 1f;
        this.m_Energy.maxValue    = playerConditionModule.GetMaxEnergy();
        this.m_Energy.value       = playerConditionModule.GetEnergy();
        this.m_Sanity.minValue    = 0f;
        this.m_Sanity.maxValue    = 100f;
        this.m_Sanity.value       = (float)PlayerSanityModule.Get().m_Sanity;
        this.m_Dirtiness.minValue = 0f;
        this.m_Dirtiness.maxValue = PlayerConditionModule.Get().m_MaxDirtiness;
        this.m_Dirtiness.value    = PlayerConditionModule.Get().m_Dirtiness;
    }
Пример #2
0
    private void Setup()
    {
        this.m_ToggleLimbs.Clear();
        this.m_ToggleLimbsState.Clear();
        this.m_ToggleLimbs.Add(this.m_ToggleLH);
        this.m_ToggleLimbsState.Add(this.m_ToggleLH.isOn);
        this.m_ToggleLimbs.Add(this.m_ToggleRH);
        this.m_ToggleLimbsState.Add(this.m_ToggleRH.isOn);
        this.m_ToggleLimbs.Add(this.m_ToggleLL);
        this.m_ToggleLimbsState.Add(this.m_ToggleLL.isOn);
        this.m_ToggleLimbs.Add(this.m_ToggleRL);
        this.m_ToggleLimbsState.Add(this.m_ToggleRL.isOn);
        this.m_WoundTypeList.Clear();
        for (int i = 0; i < Enum.GetValues(typeof(InjuryType)).Length; i++)
        {
            this.m_WoundTypeList.AddElement(Enum.GetValues(typeof(InjuryType)).GetValue(i).ToString(), -1);
        }
        this.m_WoundTypeList.SetFocus(true);
        this.m_WoundParameters.Clear();
        for (int j = 0; j < 10; j++)
        {
            Transform transform = base.gameObject.transform.FindDeepChild("Wound" + j.ToString());
            if (transform != null)
            {
                Text component = transform.gameObject.GetComponent <Text>();
                this.m_WoundParameters.Add(component);
            }
        }
        PlayerConditionModule playerConditionModule = PlayerConditionModule.Get();

        this.m_Proteins.minValue  = 0f;
        this.m_Proteins.maxValue  = playerConditionModule.GetMaxNutritionProtein();
        this.m_Proteins.value     = playerConditionModule.GetNutritionProtein();
        this.m_Fat.minValue       = 0f;
        this.m_Fat.maxValue       = playerConditionModule.GetMaxNutritionFat();
        this.m_Fat.value          = playerConditionModule.GetNutritionFat();
        this.m_Carbo.minValue     = 0f;
        this.m_Carbo.maxValue     = playerConditionModule.GetMaxNutritionCarbo();
        this.m_Carbo.value        = playerConditionModule.GetNutritionCarbo();
        this.m_Hydration.minValue = 0f;
        this.m_Hydration.maxValue = playerConditionModule.GetMaxHydration();
        this.m_Hydration.value    = playerConditionModule.GetHydration();
        this.m_HP.minValue        = 0f;
        this.m_HP.maxValue        = playerConditionModule.GetMaxHP();
        this.m_HP.value           = playerConditionModule.GetHP();
        this.m_Energy.minValue    = 0f;
        this.m_Energy.maxValue    = playerConditionModule.GetMaxEnergy();
        this.m_Energy.value       = playerConditionModule.GetEnergy();
        this.m_Sanity.minValue    = 0f;
        this.m_Sanity.maxValue    = 100f;
        this.m_Sanity.value       = (float)PlayerSanityModule.Get().m_Sanity;
    }