public void OnButtonPress()
 {
     if (_material != null)
     {
         if (_material.color == MyRed)
         {
             print(transform.parent.gameObject.name + "Button Pressed");
             SaveClickData.Save();
             Variables.ClickPositions.Add(Variables.ClickPosition);
             OnButtonPressAction();
         }
     }
 }
Beispiel #2
0
    private void ButtonMissed()
    {
        isButtonMissed      = true;
        Variables.ClickTime = Variables.GetCurrentUnixTimestampMillis();
        Variables.MissedTimeSinceLastHit = (Variables.Times.Count > 0)
            ? (Variables.GetCurrentUnixTimestampMillis() - Variables.MinusTime) -
                                           Variables.Times[Variables.Times.Count - 1]
            : 0;

        if (Variables.MissedTimeSinceLastHit >= 30)
        {
            print(transform.parent.gameObject.name + "Button Missed");
            SaveClickData.Save();
        }
    }