Пример #1
0
    //Unity calls this when the object is turned on
    public void OnEnable()
    {
        if(!m_IsInitialized)
        {
            Initialize();
        }

        //setting up inital values
        m_HungerAddedWhenHungrySlider.SetValue(m_PetManager.GetActivePet().m_HungerAddedWhenHungry);
        m_HungerRemovedWhenFedSlider.SetValue(m_PetManager.GetActivePet().m_HungerRemovedWhenFed);
        m_HungerTimerInSeconds.SetValue(m_PetManager.GetActivePet().m_HungerTimerInSeconds);
        m_TimeBetweenFeedsSlider.SetValue(m_PetManager.GetActivePet().m_TimeBetweenFeeds);

        m_HappinessRemovedOverTimeSlider.SetValue(m_PetManager.GetActivePet().m_HappinessRemovedOverTime);
        m_HappinessAddedWhenPetSlider.SetValue(m_PetManager.GetActivePet().m_HappinessAddedWhenPet);
        m_HappinessDecayInSecondsSlider.SetValue(m_PetManager.GetActivePet().m_HappinessDecayInSeconds);
        m_TimeBetweenCuddlesSlider.SetValue(m_PetManager.GetActivePet().m_TimeBetweenCuddles);
    }