Exemplo n.º 1
0
    protected void AddUpBtns()
    {
        this.UpWays = StrongerManager.Instance.GetLowest3StrongerData();
        for (int i = 0; i < this.UpWays.get_Count(); i++)
        {
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("UpBtn");
            instantiate2Prefab.get_transform().SetParent(this.UpBtns.get_transform(), true);
            Transform              transform = instantiate2Prefab.get_transform().FindChild("BtnBg");
            StrongerType           type      = this.UpWays.get_Item(i).Type;
            BianQiangJieMianPeiZhi bianQiangJieMianPeiZhi = DataReader <BianQiangJieMianPeiZhi> .Get((int)type);

            Image component = transform.GetComponent <Image>();
            if (bianQiangJieMianPeiZhi != null && bianQiangJieMianPeiZhi.icon2 > 0)
            {
                ResourceManager.SetSprite(component, GameDataUtils.GetIcon(bianQiangJieMianPeiZhi.icon2));
            }
            component.SetNativeSize();
            if (transform is RectTransform)
            {
                (transform as RectTransform).set_pivot(ConstVector2.ML);
            }
            switch (type)
            {
            case StrongerType.Equip:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnEquipLv);
                break;

            case StrongerType.EquipStrength:
            case StrongerType.EquipStarUp:
            case StrongerType.EquipEnchantment:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnEquipQua);
                break;

            case StrongerType.Gem:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnGemLv);
                break;

            case StrongerType.Wing:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnWing);
                break;

            case StrongerType.PetLevel:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnPetLv);
                break;

            case StrongerType.PetUpgrade:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnPetStar);
                break;

            case StrongerType.GodSoldier:
                instantiate2Prefab.get_transform().GetComponent <ButtonCustom>().onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnGodSoldier);
                break;

            default:
                Debug.Log("There is no exist Upway, ID = " + this.UpType);
                break;
            }
        }
    }
Exemplo n.º 2
0
    public string GetProgressDescByStrongerType(StrongerType type)
    {
        string empty = string.Empty;
        int    lv    = EntityWorld.Instance.EntSelf.Lv;
        DangQianDengJiLiLunZhanLi dangQianDengJiLiLunZhanLi = DataReader <DangQianDengJiLiLunZhanLi> .Get(lv);

        if (dangQianDengJiLiLunZhanLi == null)
        {
            return(empty);
        }
        int id  = 0;
        int id2 = 0;

        switch (type)
        {
        case StrongerType.Equip:
            id2 = dangQianDengJiLiLunZhanLi.equipExplain;
            break;

        case StrongerType.EquipStrength:
            id2 = dangQianDengJiLiLunZhanLi.strengthenExplain;
            break;

        case StrongerType.EquipStarUp:
            id2 = dangQianDengJiLiLunZhanLi.equipStarExplain;
            break;

        case StrongerType.EquipEnchantment:
            id2 = dangQianDengJiLiLunZhanLi.enchantExplain;
            break;

        case StrongerType.Gem:
            id2 = dangQianDengJiLiLunZhanLi.diamondExplain;
            break;

        case StrongerType.Wing:
            id2 = dangQianDengJiLiLunZhanLi.wingExplain;
            break;

        case StrongerType.PetLevel:
            id2 = dangQianDengJiLiLunZhanLi.petLvExplain;
            break;

        case StrongerType.PetUpgrade:
            id2 = dangQianDengJiLiLunZhanLi.petStarExplain;
            break;

        case StrongerType.GodSoldier:
            id2 = dangQianDengJiLiLunZhanLi.shenBingExplain;
            break;
        }
        BianQiangJieMianPeiZhi bianQiangJieMianPeiZhi = DataReader <BianQiangJieMianPeiZhi> .Get((int)type);

        if (bianQiangJieMianPeiZhi != null)
        {
            id = bianQiangJieMianPeiZhi.name3;
        }
        return(GameDataUtils.GetChineseContent(id, false) + ": <color=#ff7d4b>" + GameDataUtils.GetChineseContent(id2, false) + "</color>");
    }
Exemplo n.º 3
0
    public float GetProgressByStrongerType(StrongerType type)
    {
        float result = 0f;
        long  fightingByStrongerType         = this.GetFightingByStrongerType(type);
        int   standardFightingByStrongerType = this.GetStandardFightingByStrongerType(type);

        if (standardFightingByStrongerType > 0)
        {
            result = (float)fightingByStrongerType / ((float)standardFightingByStrongerType * 1f);
        }
        return(result);
    }
Exemplo n.º 4
0
    public int GetStandardFightingByStrongerType(StrongerType type)
    {
        int result = 0;
        int lv     = EntityWorld.Instance.EntSelf.Lv;
        DangQianDengJiLiLunZhanLi dangQianDengJiLiLunZhanLi = DataReader <DangQianDengJiLiLunZhanLi> .Get(lv);

        if (dangQianDengJiLiLunZhanLi == null)
        {
            return(result);
        }
        switch (type)
        {
        case StrongerType.Equip:
            result = dangQianDengJiLiLunZhanLi.equip;
            break;

        case StrongerType.EquipStrength:
            result = dangQianDengJiLiLunZhanLi.strengthen;
            break;

        case StrongerType.EquipStarUp:
            result = dangQianDengJiLiLunZhanLi.equipStar;
            break;

        case StrongerType.EquipEnchantment:
            result = dangQianDengJiLiLunZhanLi.enchant;
            break;

        case StrongerType.Gem:
            result = dangQianDengJiLiLunZhanLi.diamond;
            break;

        case StrongerType.Wing:
            result = dangQianDengJiLiLunZhanLi.wing;
            break;

        case StrongerType.PetLevel:
            result = dangQianDengJiLiLunZhanLi.petLv;
            break;

        case StrongerType.PetUpgrade:
            result = dangQianDengJiLiLunZhanLi.petStar;
            break;

        case StrongerType.GodSoldier:
            result = dangQianDengJiLiLunZhanLi.shenBing;
            break;
        }
        return(result);
    }
Exemplo n.º 5
0
    public long GetFightingByStrongerType(StrongerType type)
    {
        long result = 0L;

        switch (type)
        {
        case StrongerType.Equip:
            result = EquipGlobal.GetAllEquipAttrValue();
            break;

        case StrongerType.EquipStrength:
            result = EquipGlobal.GetAllEquipDevelopAttrValue();
            break;

        case StrongerType.EquipStarUp:
            result = EquipGlobal.GetAllEquipStarUpAttrValue();
            break;

        case StrongerType.EquipEnchantment:
            result = EquipGlobal.GetAllEquipEnchantmentAttrValue();
            break;

        case StrongerType.Gem:
            result = GemGlobal.getAllGemAttrValue();
            break;

        case StrongerType.Wing:
            result = WingGlobal.GetCurrentWingFightingValue();
            break;

        case StrongerType.PetLevel:
            result = (long)PetManager.Instance.GetFormationPetLevel();
            break;

        case StrongerType.PetUpgrade:
            result = PetManager.Instance.GetFormationAddFighting();
            break;

        case StrongerType.GodSoldier:
            result = GodSoldierManager.Instance.GetAllGodSoliderAttrValue();
            break;
        }
        return(result);
    }
Exemplo n.º 6
0
 public StrongerInfoData(StrongerType type, int systemID)
 {
     this.Type     = type;
     this.SystemID = systemID;
 }