Beispiel #1
0
    void Start()
    {
        m_pad = GameObject.Find("Player").GetComponent <PAD>();

        //Saved current time
        m_deCounter = m_pad.GetCleanTimer(); //

        //Get the number of calls missed
        float CallsMissed      = m_pad.getTotalTimeMissed() / m_deTimer;
        int   totalCallsMissed = (int)CallsMissed;
        //Get the decimal value
        float Decimal = CallsMissed - totalCallsMissed;

        float TimeToAdd = m_deTimer * Decimal;

        m_deCounter += TimeToAdd;

        if (m_deCounter >= m_deTimer)
        {
            totalCallsMissed++;
            m_deCounter -= m_deTimer;
        }

        for (int i = 0; i < totalCallsMissed; i++)
        {
            m_pad.LoadInCleanCheck();
        }
    }
Beispiel #2
0
    void Start()
    {
        m_deTimer2  = m_deTimer;
        m_connected = false;

        m_repeatVar   = m_repeatRate;
        m_decreaseVar = m_decreaseRate;

        //Saved current time
        if (gameObject.name == "FoodUI")
        {
            m_currentHealth = m_pad.GetFoodHealth();
            m_deCounter     = m_pad.GetUIFoodtimer();
        }
        else if (gameObject.name == "CleanUI")
        {
            m_currentHealth = m_pad.GetCleanHealth();
            m_deCounter     = m_pad.GetUICleantimer();
        }
        else if (gameObject.name == "WaterUI")
        {
            m_currentHealth = m_pad.GetWaterHealth();
            m_deCounter     = m_pad.GetUIWatertimer();
        }

        //Get the number of calls missed
        float CallsMissed      = m_pad.getTotalTimeMissed() / m_deTimer;
        int   totalCallsMissed = (int)CallsMissed;
        //Get the decimal value
        float Decimal = CallsMissed - totalCallsMissed;

        float TimeToAdd = m_deTimer * Decimal;

        m_deCounter += TimeToAdd;

        if (m_deCounter >= m_deTimer)
        {
            totalCallsMissed++;
            m_deCounter -= m_deTimer;
        }

        for (int i = 0; i < totalCallsMissed; i++)
        {
            m_currentHealth -= m_decreaseRate;
            m_repeatRate     = m_repeatVar;
            m_decreaseRate   = m_decreaseVar;
        }
    }
Beispiel #3
0
    void Start()
    {
        m_transform   = GetComponent <Transform>();
        m_movement    = GetComponent <PlayerMovement>();
        m_camMovement = GameObject.Find("Main Camera").GetComponent <CameraMovement>();

        m_food                        =
            m_water                   =
                m_clean               =
                    m_notClean        =
                        m_notWater    =
                            m_notFood = false;

        m_inter           = false;
        m_actionHappening = false;
        m_rotation        = false;

        for (int i = 0; i < m_nodebool.Length; i++)
        {
            m_nodebool[i] = false;
        }

        //Saved current time
        m_deCounter = m_pad.GetInteractionTimer();

        //Get the number of calls missed
        float CallsMissed      = m_pad.getTotalTimeMissed() / m_deTimer;
        int   totalCallsMissed = (int)CallsMissed;
        //Get the decimal value
        float Decimal = CallsMissed - totalCallsMissed;

        float TimeToAdd = m_deTimer * Decimal;

        m_deCounter += TimeToAdd;

        if (m_deCounter >= m_deTimer)
        {
            totalCallsMissed++;
            m_deCounter -= m_deTimer;
        }

        for (int i = 0; i < totalCallsMissed; i++)
        {
            m_pad.LoadInInterCheck();
        }
    }