Ejemplo n.º 1
0
    void Start()
    {
        m_admob = GameObject.Find("HudGUI/ADMob").GetComponent<ADMob>();

        m_guages[0] = new YGUISystem.GUIGuage(transform.Find("Killed Mobs/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.GameBestStats.KilledMobs == 0)
                return 1f;
            return (float)Warehouse.Instance.NewGameStats.KilledMobs/Warehouse.Instance.GameBestStats.KilledMobs;
        },
        ()=>{
            if (Warehouse.Instance.GameBestStats.KilledMobs == 0)
                return Warehouse.Instance.NewGameStats.KilledMobs.ToString() + " / " + Warehouse.Instance.NewGameStats.KilledMobs.ToString();
            return Warehouse.Instance.NewGameStats.KilledMobs.ToString() + " / " + Warehouse.Instance.GameBestStats.KilledMobs.ToString();
        }
        );

        m_waveText = transform.Find("WaveGUI/Slider/Text").gameObject.GetComponent<Text>();
        m_waveText.text = (Warehouse.Instance.NewGameStats.WaveIndex+1).ToString() + " / " + (Warehouse.Instance.GameBestStats.WaveIndex+1).ToString();

        m_continueText = transform.Find("ContinueButton/Text").gameObject.GetComponent<Text>();
        m_continueText.text = "Continue at " + (Warehouse.Instance.NewGameStats.WaveIndex+1);

        m_waveSlider = transform.Find("WaveGUI/Slider").gameObject.GetComponent<Slider>();
        m_waveSlider.minValue = 0;
        m_waveSlider.maxValue = Warehouse.Instance.GameBestStats.WaveIndex+1;
        m_waveSlider.value = Warehouse.Instance.NewGameStats.WaveIndex+1;

        m_guages[1] = new YGUISystem.GUIGuage(transform.Find("Waves/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.GameBestStats.WaveIndex == 0)
                return 1f;
            return (float)Warehouse.Instance.NewGameStats.WaveIndex/Warehouse.Instance.GameBestStats.WaveIndex;
        },
        ()=>{
            if (Warehouse.Instance.GameBestStats.WaveIndex == 0)
                return "1 / 1";
            return (Warehouse.Instance.NewGameStats.WaveIndex+1).ToString() + " / " + (Warehouse.Instance.GameBestStats.WaveIndex+1).ToString();
        }
        );

        //m_admob.ShowInterstitial();
        m_admob.ShowBanner(true);

        Warehouse.Instance.CurrentWaveIndex = Warehouse.Instance.GameOptions.m_reWaveIndex.Value;
        OnClickContinue();
    }