Exemple #1
0
    private void AssessResponse(Statement statement, int index)
    {
        if (DoesStatementContradict(statement))
        {
            UpdateScore(-1);

            statementButtons[index].Contradicted();

            onContradiction.RaiseEvent();
            return;
        }

        if (IsStatementDisliked(statement))
        {
            UpdateScore(-1);
            statementButtons[index].Disliked();
            onDislike.RaiseEvent();

            return;
        }

        if (IsStatementLiked(statement))
        {
            UpdateScore(1);
            statementButtons[index].Liked();
            onLike.RaiseEvent();

            return;
        }
    }
Exemple #2
0
    public void GenerateSetOfFour()
    {
        if (allStatements.Count < 4)
        {
            StopAllCoroutines();

            StopAllCoroutines();
            optionsRoot.DestroyChildren();
            music.Stop();
            onLose.RaiseEvent();
            gameEnded = true;

            return;
        }

        List <int> randomIndecies = new List <int> ();

        while (randomIndecies.Count < 4)
        {
            int index = Random.Range(0, allStatements.Count);

            if (!randomIndecies.Contains(index))
            {
                randomIndecies.Add(index);
            }
        }

        statementOptions = new Statement[4];

        statementOptions[0] = allStatements[randomIndecies[0]];
        statementOptions[1] = allStatements[randomIndecies[1]];
        statementOptions[2] = allStatements[randomIndecies[2]];
        statementOptions[3] = allStatements[randomIndecies[3]];

        PresentOptions();
    }
Exemple #3
0
 private void CheckWinLoseState()
 {
     if (loveBar.fillAmount >= 1)
     {
         StopAllCoroutines();
         optionsRoot.DestroyChildren();
         music.Stop();
         onWin.RaiseEvent();
         gameEnded = true;
     }
     else if (loveBar.fillAmount <= 0)
     {
         StopAllCoroutines();
         optionsRoot.DestroyChildren();
         music.Stop();
         onLose.RaiseEvent();
         gameEnded = true;
     }
 }
Exemple #4
0
    private IEnumerator CountDownTime()
    {
        float timeElapsed = 0;

        while (timeElapsed < timerLength)
        {
            timeElapsed          += Time.deltaTime;
            timerImage.fillAmount = 1 - (timeElapsed / timerLength);

            yield return(null);
        }

        UpdateScore(-1);

        Transform timeLossInstance = Instantiate(timeLossPrefab, usedOptionsRoot);

        timeLossInstance.SetSiblingIndex(0);

        onTimeTooLong.RaiseEvent();

        ResetOptions();
    }
 // Start is called before the first frame update
 void Start()
 {
     thing.RaiseEvent();
 }
 public void RaiseEventWithZeroListeners()
 {
     Assert.False(appEvent.RaiseEvent());
 }
Exemple #7
0
 public void raise()
 {
     appEvent.RaiseEvent();
 }