Beispiel #1
0
    private void HandleTime()
    {
        if (m_bombBall != null && m_start)
        {
            Vector3 position = m_bombBall.GetPosition();
            if (position.y > 1.5f)
            {
                m_aiBombTime += Time.deltaTime;
                if (m_aiBombTime > m_aiTotalBombTime)
                {
                    GameAudioModuel audioModuel = GameStart.GetInstance().AudioModuel;
                    m_bombBall.PlayBomb();
                    m_bombUI.ShowEnd(true);

                    if (m_playerController.gameObject.activeSelf)
                    {
                        audioModuel.PlayAudio(new List <string> {
                            "explode_03", "win"
                        });
                    }
                    m_playerController.gameObject.SetActive(false);
                }
                m_end = true;
                float value = m_aiBombTime / m_aiTotalBombTime;
                m_bombBall.SetBombScale(value);
            }
            else if (position.y < -1.5f)
            {
                m_playerBombTime += Time.deltaTime;
                if (m_playerBombTime > m_playerTotalBombTime)
                {
                    GameAudioModuel audioModuel = GameStart.GetInstance().AudioModuel;
                    m_bombBall.PlayBomb();
                    //audioModuel.PlayAudio("explode_03");
                    m_bombUI.ShowEnd(false);

                    if (m_playerController.gameObject.activeSelf)
                    {
                        audioModuel.PlayAudio(new List <string> {
                            "explode_03", "lose"
                        });
                    }

                    m_playerController.gameObject.SetActive(false);
                }
                m_end = true;
                float value = m_playerBombTime / m_playerTotalBombTime;
                m_bombBall.SetBombScale(value);
            }
        }
    }