Exemple #1
0
    public void HandleTimers()
    {
        if (BtnM2.Button1 == true & BtnM2.Button2 == true)
        {
            G4.LogEvent("PressButton", "Section1Timer", "TimeStart", 1);

            // Builder Hit with all Event parameters.
            G4.LogEvent(new EventHitBuilder()
                        .SetEventCategory("PressButton")
                        .SetEventAction("Section1Timer")
                        .SetEventLabel("TimeStart")
                        .SetEventValue(1));

            Debug.Log("Sent");
            TimerVis.SetActive(true);
            Timer.text = "" + Timer1.ToString("f2");
            Timer1     = Timer1 - Time.deltaTime;
            if (Timer1 <= 0.2f)
            {
                TimerVis.SetActive(false);
                Timer1 = 5.2f;
            }
        }
        if (BtnM2.Button3 == true & BtnM2.Button4 == true)
        {
            G4.LogEvent("PressButton", "Section2Timer", "TimeStart", 1);

            // Builder Hit with all Event parameters.
            G4.LogEvent(new EventHitBuilder()
                        .SetEventCategory("PressButton")
                        .SetEventAction("Section2Timer")
                        .SetEventLabel("TimeStart")
                        .SetEventValue(1));

            Debug.Log("Sent");
            TimerVis.SetActive(true);
            Timer.text = "" + Timer2.ToString("f2");
            Timer2     = Timer2 - Time.deltaTime;
            if (Timer2 <= 0.2f)
            {
                TimerVis.SetActive(false);
                Timer2 = 1.2f;
            }
        }
        if (BtnM2.Button5 == true & BtnM2.Button6 == true & BtnM2.Button7 == true)
        {
            G4.LogEvent("PressButton", "Section3Timer", "TimeStart", 1);

            // Builder Hit with all Event parameters.
            G4.LogEvent(new EventHitBuilder()
                        .SetEventCategory("PressButton")
                        .SetEventAction("Section3Timer")
                        .SetEventLabel("TimeStart")
                        .SetEventValue(1));

            Debug.Log("Sent");
            TimerVis.SetActive(true);
            Timer.text = "" + Timer3.ToString("f2");
            Timer3     = Timer3 - Time.deltaTime;
            if (Timer3 <= 0.2f)
            {
                TimerVis.SetActive(false);
                Timer3 = 5.2f;
            }
        }
        if (BtnM2.Button8 == true & BtnM2.Button9 == true & BtnM2.Button10 == true & BtnM2.Button11 == true)
        {
            G4.LogEvent("PressButton", "Section4Timer", "TimeStart", 1);

            // Builder Hit with all Event parameters.
            G4.LogEvent(new EventHitBuilder()
                        .SetEventCategory("PressButton")
                        .SetEventAction("Section4Timer")
                        .SetEventLabel("TimeStart")
                        .SetEventValue(1));

            Debug.Log("Sent");
            TimerVis.SetActive(true);
            Timer.text = "" + Timer4.ToString("f2");
            Timer4     = Timer4 - Time.deltaTime;
            if (Timer4 <= 0.2f)
            {
                TimerVis.SetActive(false);
                Timer4 = 3.2f;
            }
        }
        if (BtnM2.Button12 == true & BtnM2.Button13 == true & BtnM2.Button14 == true & BtnM2.Button15 == true)
        {
            G4.LogEvent("PressButton", "Section5Timer", "TimeStart", 1);

            // Builder Hit with all Event parameters.
            G4.LogEvent(new EventHitBuilder()
                        .SetEventCategory("PressButton")
                        .SetEventAction("Section5Timer")
                        .SetEventLabel("TimeStart")
                        .SetEventValue(1));

            Debug.Log("Sent");
            TimerVis.SetActive(true);
            Timer.text = "" + Timer5.ToString("f2");
            Timer5     = Timer5 - Time.deltaTime;
            if (Timer5 <= 0.2f)
            {
                TimerVis.SetActive(false);
                Timer5 = 2.2f;
            }
        }
        if (BtnM2.Button16 == true & BtnM2.Button17 == true)
        {
            G4.LogEvent("PressButton", "Section6Timer", "TimeStart", 1);

            // Builder Hit with all Event parameters.
            G4.LogEvent(new EventHitBuilder()
                        .SetEventCategory("PressButton")
                        .SetEventAction("Section6Timer")
                        .SetEventLabel("TimeStart")
                        .SetEventValue(1));

            Debug.Log("Sent");
            TimerVis.SetActive(true);
            Timer.text = "" + Timer6.ToString("f2");
            Timer6     = Timer6 - Time.deltaTime;
            if (Timer6 <= 0.2f)
            {
                TimerVis.SetActive(false);
                Timer6 = 1.2f;
            }
        }
    }