Ejemplo n.º 1
0
    protected virtual void CheckResult()
    {
        m_answer = m_sObjs.FirstOrDefault(a => a.id == selectedId);

        bool result = CheckMatch(m_answer);

        if (onLevelComplete != null)
        {
            onLevelComplete(result);
        }

        AudioMng.PlayOneShot(m_answer.selectionData.clip);

        if (!result)
        {
            m_isRestarting = true;
            wallTrans.DOMoveY(m_wallStartPos.y, 1f)
            .SetEase(Ease.OutQuad)
            .OnComplete(() => m_isRestarting = false);

            CameraShake.ShakeAll();
        }
        else
        {
            GameOver();
        }
    }
Ejemplo n.º 2
0
    protected override void GameOver()
    {
        m_isGameOver = true;

        AudioMng.PlayOneShot(m_answer.selectionData.clip);

        GameData.LevelSkip = m_answer.levelSkip;

        //FIXME: I need the true symbol!
        GameData.SymbolSprites.Add((m_isWin) ? successSymbol : breakupSymbol);
        GameData.IsBreakup = !m_isWin;

        StartCoroutine(EndGameDelay());
    }
Ejemplo n.º 3
0
    public void Update()
    {
        if (PhaseState != PhaseStates.Playing)
        {
            return;
        }

        if (!m_isFinished)
        {
            if (Input.GetMouseButtonDown(0))
            {
                Index++;
                AudioMng.PlayOneShot(successSnd);
            }
        }
    }
Ejemplo n.º 4
0
    protected virtual void CheckResult()
    {
        m_answer = m_sObjs.FirstOrDefault(a => a.id == selectedId);

        m_isWin = CheckMatch(m_answer);

        WallState += dialogDatas[ChatDialogState].wallStateEffect;

        chatDialogSpr.sprite = dialogDatas[m_chatDialogState].GetRandomSpr();

        AudioMng.PlayOneShot(dialogDatas[ChatDialogState].feedbackClip);

        if (onLevelComplete != null)
        {
            onLevelComplete(m_isWin);
        }

        // End game if no more try
        m_tryLeft--;

        if (m_tryLeft <= 0)
        {
            GameOver();
            return;
        }

        if (!m_isWin)
        {
            m_isRestarting = true;
            wallTrans.DOMoveY(m_wallStartPos.y, 1f)
            .SetEase(Ease.OutQuad)
            .OnComplete(() => m_isRestarting = false);
        }
        else
        {
            GameOver();
        }
    }