Пример #1
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (IsHit == false && m_GameData.HasGameFinished() == false)
     {
         if (collision.gameObject.CompareTag("Bullet"))
         {
             if (AnswerIndex == m_GameData.GetFinalAnswerIndex())
             {
                 m_Checkbox.Correct();
                 m_Scores.AddScores();
                 m_GameData.SetGuessed();
             }
             else
             {
                 m_Scores.AddWrongScore();
                 if (GameSettings.Instance.GetGameMode() == GameSettings.EGameMode.SURVIVAL_MODE)
                 {
                     m_SurvivalHearts.RemoveLife();
                 }
                 m_Checkbox.Wrong();
             }
             LoadNewGame = true;
         }
     }
     StartCoroutine(Sleep());
 }
Пример #2
0
    private void OnMouseDown()
    {
        if (ButtonPressed == false && m_GameData.HasGameFinished() == false)
        {
            if (FlagIndex == m_GameData.GetFinalFlagIndex())
            {
                m_Checkbox.Correct();
                m_Scores.AddScores();
                if (GameSettings.Instance.GetGameMode() == GameSettings.EGameMode.SHORT_MODE)
                {
                    m_ShortGame.Rotate(true);
                }
            }
            else
            {
                m_Scores.AddWrongScore();
                if (GameSettings.Instance.GetGameMode() == GameSettings.EGameMode.SURVIVAL_MODE)
                {
                    m_SurvivalLifes.RemoveLife();
                }
                else if (GameSettings.Instance.GetGameMode() == GameSettings.EGameMode.SHORT_MODE)
                {
                    m_ShortGame.Rotate(false);
                }
                m_Checkbox.Wrong();
            }

            LoadNewGame = true;
        }

        if (gameObject.activeSelf)
        {
            StartCoroutine(Sleep());
        }
    }