// Use this for initialization
    void Start()
    {
        m_creature = transform.parent.gameObject.GetComponent<Creature>();
        m_guage = new YGUISystem.GUIGuage(transform.Find("Canvas/HP").gameObject,
                                           ()=>{return guageRemainRatio();},
        ()=>{return ""; }
        );

        Transform trans = transform.Find("Canvas/HP/Level/Text");
        if (trans != null)
        {
            m_level = new YGUISystem.GUILable(trans.gameObject);
        }

        Vector3 pos = m_creature.HPPointTransform.localPosition;
        pos.y += 1.5f;
        m_guage.RectTransform.transform.localPosition = pos;
        m_guage.RectTransform.transform.localScale = m_creature.HPPointTransform.localScale;
    }
Esempio n. 2
0
    void Start()
    {
        string[] dir = {"Contents/Strength",
                        "Contents/RegenSP",
                        "Contents/GainExtraGold",
                        "Contents/DamageReduction",
                        "Contents/DamageMultiplier",
                        "Contents/CriticalChance",
                        "Contents/CriticalDamage",
                        "Contents/TapDamage",
                        "Contents/LifeSteal",
            "Contents/Dodge",
            "Contents/StatisticsDealDmgPS",
            "Contents/StatisticsTakenDmgPS",
            "Contents/StatisticsKillPS",
            "Contents/StatisticsConsumedSPPS",
            "Contents/StatisticsWave",
                    };
        transform.Find(dir[(int)DirIndex.Strength]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.Strength) + ":";
        transform.Find(dir[(int)DirIndex.RegenSP]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.RegenSP) + ":";
        transform.Find(dir[(int)DirIndex.GainExtraGold]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.GainExtraGold) + ":";
        transform.Find(dir[(int)DirIndex.DamageReduction]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.Deffence) + ":";
        transform.Find(dir[(int)DirIndex.DamageMultiplier]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.DamageMultiplier) + ":";
        transform.Find(dir[(int)DirIndex.CriticalChance]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.CriticalChance) + ":";
        transform.Find(dir[(int)DirIndex.CriticalDamage]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.CriticalDamage) + ":";
        transform.Find(dir[(int)DirIndex.TapDamage]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.TapDamage) + ":";
        transform.Find(dir[(int)DirIndex.LifeSteal]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.LifeSteal) + ":";
        transform.Find(dir[(int)DirIndex.Dodge]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.Dodge) + ":";
        transform.Find(dir[(int)DirIndex.StatisticsDealDmgPS]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.DealDmgPerSec) + ":";
        transform.Find(dir[(int)DirIndex.StatisticsTakenDmgPS]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.TakenDmgPerSec) + ":";
        transform.Find(dir[(int)DirIndex.StatisticsKillPS]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.KillMobs) + ":";
        transform.Find(dir[(int)DirIndex.StatisticsConsumedSPPS]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.ConsumeSPPerSec) + ":";
        transform.Find(dir[(int)DirIndex.StatisticsWave]).GetComponent<Text>().text = RefData.Instance.RefTexts(MultiLang.ID.Wave) + ":";

        m_strength =  new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.Strength]+"/Text").gameObject);
        m_regenSP = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.RegenSP]+"/Text").gameObject);
        m_gainExtraGold = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.GainExtraGold]+"/Text").gameObject);
        m_damageReduction = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.DamageReduction]+"/Text").gameObject);
        m_damageMultiplier = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.DamageMultiplier]+"/Text").gameObject);
        m_criticalChance = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.CriticalChance]+"/Text").gameObject);
        m_criticalDamage = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.CriticalDamage]+"/Text").gameObject);
        m_tapDamage = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.TapDamage]+"/Text").gameObject);
        m_lifeSteal = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.LifeSteal]+"/Text").gameObject);
        m_dodge = new YGUISystem.GUILable(transform.Find(dir[(int)DirIndex.Dodge]+"/Text").gameObject);

        m_guages[0] = new YGUISystem.GUIGuage(transform.Find(dir[(int)DirIndex.StatisticsDealDmgPS]+"/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.NewGameStats.DealDamagePerSec == 0)
                return 0f;
            return Warehouse.Instance.NewGameStats.DealDamagePerSec/Warehouse.Instance.NewGameStats.MaxDealDamagePerSec;
        },
        ()=>{
            if (Warehouse.Instance.NewGameStats.MaxDealDamagePerSec == 0)
                return 0 + " / " + 0;

            return System.String.Format("{0:F2} / {1}",Warehouse.Instance.NewGameStats.DealDamagePerSec, Warehouse.Instance.NewGameStats.MaxDealDamagePerSec);
        }
        );

        m_guages[1] = new YGUISystem.GUIGuage(transform.Find(dir[(int)DirIndex.StatisticsTakenDmgPS]+"/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.NewGameStats.TakenDamagePerSec == 0)
                return 0f;
            return Warehouse.Instance.NewGameStats.TakenDamagePerSec/Warehouse.Instance.NewGameStats.MaxTakenDamagePerSec;
        },
        ()=>{
            if (Warehouse.Instance.NewGameStats.MaxTakenDamagePerSec == 0)
                return 0 + " / " + 0;

            return System.String.Format("{0:F2} / {1}",Warehouse.Instance.NewGameStats.TakenDamagePerSec, Warehouse.Instance.NewGameStats.MaxTakenDamagePerSec);
        }
        );

        m_guages[2] = new YGUISystem.GUIGuage(transform.Find(dir[(int)DirIndex.StatisticsKillPS]+"/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.GameBestStats.KilledMobs == 0)
                return 0f;
            return (float)(Warehouse.Instance.NewGameStats.KilledMobs)/Warehouse.Instance.GameBestStats.KilledMobs;
        },
        ()=>{
            if (Warehouse.Instance.GameBestStats.KilledMobs == 0)
                return 0 + " / " + 0;

            return System.String.Format("{0} / {1}",Warehouse.Instance.NewGameStats.KilledMobs, Warehouse.Instance.GameBestStats.KilledMobs);
        }
        );

        m_guages[3] = new YGUISystem.GUIGuage(transform.Find(dir[(int)DirIndex.StatisticsConsumedSPPS]+"/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.NewGameStats.ConsumedSPPerSec == 0)
                return 0f;
            return Warehouse.Instance.NewGameStats.ConsumedSPPerSec/Warehouse.Instance.NewGameStats.MaxConsumedSPPerSec;
        },
        ()=>{
            if (Warehouse.Instance.NewGameStats.MaxConsumedSPPerSec == 0)
                return 0 + " / " + 0;

            return System.String.Format("{0:F2} / {1}",Warehouse.Instance.NewGameStats.ConsumedSPPerSec, Warehouse.Instance.NewGameStats.MaxConsumedSPPerSec);
        }
        );

        m_guages[4] = new YGUISystem.GUIGuage(transform.Find(dir[(int)DirIndex.StatisticsWave]+"/Guage/Guage").gameObject,
                                              ()=>{
            if (Warehouse.Instance.GameBestStats.WaveIndex == 0)
                return 1f;
            return (float)(Warehouse.Instance.NewGameStats.WaveIndex+1)/(Warehouse.Instance.GameBestStats.WaveIndex+1);
        },
        ()=>{
            if (Warehouse.Instance.GameBestStats.WaveIndex == 0)
                return "1 / 1";
            return (Warehouse.Instance.NewGameStats.WaveIndex+1).ToString() + " / " + (Warehouse.Instance.GameBestStats.WaveIndex+1).ToString();
        }
        );
    }
Esempio n. 3
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();
    }
Esempio n. 4
0
    void Start()
    {
        m_level = new YGUISystem.GUILable(transform.Find("Level/Text").gameObject);
        m_gold = transform.Find("Gold/RawImage/Text").gameObject.GetComponent<ComboGUIShake>();
        m_goldMedal = transform.Find("GoldMedal/RawImage/Text").gameObject.GetComponent<ComboGUIShake>();
        m_mobKills = transform.Find("Kills/RawImage/Text").gameObject.GetComponent<ComboGUIShake>();
        m_gem = transform.Find("Gem/RawImage/Text").gameObject.GetComponent<ComboGUIShake>();
        m_dna = transform.Find("DNA/RawImage/Text").gameObject.GetComponent<ComboGUIShake>();

        m_autoEarnButton = new YGUISystem.GUIButton(transform.Find("Special/AutoEarnButton").gameObject, ()=>{
            m_autoEarnButton.Lable.Text.text = Warehouse.Instance.AutoEarnGold.ToString();
            return Warehouse.Instance.AutoEarnGold > 0;
        });

        assignSkillButton(0, Warehouse.Instance.FindItem(21), ()=>{
            return Warehouse.Instance.FindItem(21).Item.Use(m_champ);
        });

        assignSkillButton(1, Warehouse.Instance.FindItem(22), ()=>{
            if (Warehouse.Instance.FindItem(22).Item.Use(m_champ))
            {
                m_champ.Followers.ForEach((Creature follower)=>{
                    Warehouse.Instance.FindItem(22).Item.Use(follower);
                });
                return true;
            }
            return false;
        });

        assignSkillButton(2, Warehouse.Instance.FindItem(23), ()=>{
            return Warehouse.Instance.FindItem(23).Item.Use(m_champ);
        });

        assignSkillButton(3, Warehouse.Instance.FindItem(24), ()=>{
            if (Warehouse.Instance.FindItem(24).Item.Use(m_champ))
            {
                m_champ.Followers.ForEach((Creature follower)=>{
                    Warehouse.Instance.FindItem(24).Item.Use(follower);
                });
                return true;
            }
            return false;
        });

        assignSkillButton(4, Warehouse.Instance.FindItem(25), ()=>{
            return Warehouse.Instance.FindItem(25).Item.Use(m_champ);
        });

        m_guages[0] = new YGUISystem.GUIGuage(transform.Find("Guage/HP").gameObject,
            ()=>{return m_champ.m_creatureProperty.getHPRemainRatio();},
            ()=>{return Mathf.FloorToInt(m_champ.m_creatureProperty.HP).ToString() + " / " + Mathf.FloorToInt(m_champ.m_creatureProperty.MaxHP).ToString();
            }
        );

        m_guages[1] = new YGUISystem.GUIGuage(transform.Find("Guage/XP").gameObject,
            ()=>{return m_champ.m_creatureProperty.getExpRemainRatio();},
            ()=>{return Mathf.FloorToInt(m_champ.m_creatureProperty.Exp).ToString() + " / " + Mathf.FloorToInt(m_champ.m_creatureProperty.MaxExp).ToString();
            }
        );

        m_guages[2] = new YGUISystem.GUIGuage(transform.Find("Guage/SP").gameObject,
            ()=>{return m_champ.m_creatureProperty.getSPRemainRatio();},
            ()=>{return Mathf.FloorToInt(m_champ.m_creatureProperty.SP).ToString() + " / " + Mathf.FloorToInt(m_champ.m_creatureProperty.MaxSP).ToString();
            }
        );

        m_guages[3] = new YGUISystem.GUIGuage(transform.Find("Guage/Shield").gameObject,
                                              ()=>{return 1f;},
        ()=>{return m_champ.m_creatureProperty.Shield.ToString();
        }
        );
    }