예제 #1
0
    /// <summary>
    /// Puts the correct item in the missing position on the current row automatically.
    /// </summary>
    public IEnumerator PutItem()
    {
        Global.lockMouse = true;
        iTween.MoveTo(this.gameObject,
                      new Vector3(transform.position.x, Constants.SELECT_ITEM_HIGHER_Y, transform.position.z),
                      Constants.SELECT_ITEM_MOVE_TIME);

        yield return(new WaitForSeconds(Constants.SELECT_ITEM_MOVE_TIME));

        iTween.MoveTo(this.gameObject, m_missingItemPosition, Constants.SELECT_ITEM_MOVE_TIME);

        yield return(new WaitForSeconds(Constants.SELECT_ITEM_MOVE_TIME));

        iTween.MoveTo(this.gameObject,
                      new Vector3(transform.position.x, Constants.ITEM_GROUND_LEVEL, transform.position.z),
                      Constants.SELECT_ITEM_MOVE_TIME);

        yield return(new WaitForSeconds(Constants.SELECT_ITEM_MOVE_TIME));

        m_selectItemManager.CreateRowCompleteParticles();

        yield return(new WaitForSeconds(Constants.WAIT_BEFORE_UNCLOCK_MOUSE));

        m_selectItemManager.DestroyParticles();
        m_showReel.Add(this.gameObject);
        m_rowsManager.NextRow();
    }
예제 #2
0
    private IEnumerator EndGame()
    {
        // In medium, we remove clouds first, than close covers.
        if (Game.SuperMode == Game.Difficulty.Medium)
        {
            // destroy clouds.
            m_rows[m_currentRow].DestroyClouds();

            yield return(new WaitForSeconds(Constants.CLOUD_TIME));

            // than, cover row.
            m_rows[m_currentRow].Cover();
        }
        else
        {
            m_rows[m_currentRow].Cover();             // cover the done row.
        }

        yield return(new WaitForSeconds(Constants.COVER_MOVE_TIME + Constants.INBETWEEN_COVERS_TIME));

        // close select items.
        m_selectItemsManager.CoverItems();

        yield return(new WaitForSeconds(Constants.COVER_MOVE_TIME + Constants.INBETWEEN_COVERS_TIME));

        m_audioSource.PlayOneShot(m_endGameSound);
        Global.lockMouse = true;

        yield return(new WaitForSeconds(Constants.COVER_MOVE_TIME + Constants.INBETWEEN_COVERS_TIME));

        // add item to show reel.
        m_showReel.Add(m_rightItems[0]);

        Global.state = Global.State.ShowReel;

        // start show reel.
        m_showReel.Begin(true);
    }