コード例 #1
0
 public StringSlider(ConfigDataType type, string key, string displayName, int defaultValueIndex = 0, SpellConfigProperty property = SpellConfigProperty.None, params string[] options)
 {
     Options = options;
     Slider  = new DynamicSlider(type, key, displayName, defaultValueIndex, 0, options.Length - 1, property != SpellConfigProperty.None, property);
     Slider.Slider.OnValueChange += _slider_OnValueChange;
     Slider.Slider.DisplayName    = options[Slider.Slider.CurrentValue];
 }
コード例 #2
0
 void SetColumnInfo(int col, object desc, object name, object dt, object share)
 {
     ConfigDataType datatype = GetDataType(dt);
     ColumnInfo info = new ColumnInfo();
     info.SetColumnInfo(desc, name, datatype);
     mColumnInfos[col] = info;
 }
コード例 #3
0
    void Init(object data, ConfigDataType type)
    {
        m_data = data;

        m_type         = type;
        growthAtkParam = 0;
        growthDefParam = 0;

        if (m_type == ConfigDataType.Monster)
        {
            Monster mon = data as Monster;

            growthAtkParam = Core.Data.monManager.GetMonUpAtkParam(mon.config.star, mon.Star);
            growthDefParam = Core.Data.monManager.GetMonUpDefParam(mon.config.star, mon.Star);

            headBack.spriteName = "star" + mon.RTData.m_nAttr.ToString();
            RED.SetActive(true, fiveElement.gameObject);
            fiveElement.spriteName = "Attribute_" + ((int)(mon.RTData.Attribute)).ToString();
            AtlasMgr.mInstance.SetHeadSprite(head, mon.num.ToString());
            Lab_Name.text = mon.config.name;
        }
        else if (m_type == ConfigDataType.Equip)
        {
            Equipment equip = data as Equipment;
            head.atlas      = AtlasMgr.mInstance.equipAtlas;
            head.spriteName = equip.Num.ToString();
            RED.SetActive(false, fiveElement.gameObject);
            headBack.spriteName = "star6";
            Lab_Name.text       = equip.ConfigEquip.name;
        }

        InitDataUI();
    }
コード例 #4
0
 public StringSlider(ConfigDataType type, string key, string displayName, int defaultValueIndex = 0, SpellConfigProperty property = SpellConfigProperty.None, params string[] options)
 {
     Options = options;
     Slider = new DynamicSlider(type, key, displayName, defaultValueIndex, 0, options.Length - 1, property != SpellConfigProperty.None, property);
     Slider.Slider.OnValueChange += _slider_OnValueChange;
     Slider.Slider.DisplayName = options[Slider.Slider.CurrentValue];
 }
コード例 #5
0
 public void SaveWindowData(ConfigDataType dataToSave, bool toggleValue)
 {
     if (dataToSave == ConfigDataType.DialogueToggle)
     {
         EditorPrefs.SetBool(CustomEditorPrefs.dialogueToggle, toggleValue);
     }
 }
コード例 #6
0
    void GetObject(int pid, string _str, int _starnum)
    {
        ConfigDataType type = DataCore.getDataType(pid);

        switch (type)
        {
        case ConfigDataType.Monster:
            _str     = Core.Data.monManager.getMonsterByNum(pid).name;
            _starnum = Core.Data.monManager.getMonsterByNum(pid).star;
            break;

        case ConfigDataType.Item:
            _starnum = Core.Data.itemManager.getItemData(pid).star;
            _str     = Core.Data.itemManager.getItemData(pid).name;
            break;

        case ConfigDataType.Equip:
            _starnum = Core.Data.EquipManager.getEquipConfig(pid).star;
            _str     = Core.Data.EquipManager.getEquipConfig(pid).name;
            break;

        case ConfigDataType.Gems:
            _starnum = Core.Data.gemsManager.getGemData(pid).star;
            _str     = Core.Data.gemsManager.getGemData(pid).name;
            break;

        default:
            RED.LogError(" not found  : " + pid);
            break;
        }
    }
コード例 #7
0
 private string OnDefaultPathSet(ConfigDataType defaultValueSet)
 {
     if (defaultValueSet == ConfigDataType.Plugin)
     {
         Debug.LogWarning(WarningMessages.defaultPluginPathSet);
         return(DefaultPaths.defaultPluginPath);
     }
     else if (defaultValueSet == ConfigDataType.AcousticModel)
     {
         Debug.LogWarning(WarningMessages.defaultAcousticModelPathSet);
         return(DefaultPaths.defaultAcousticModelPath);
     }
     else if (defaultValueSet == ConfigDataType.Dictionary)
     {
         Debug.LogWarning(WarningMessages.defaultDictionaryPathSet);
         return(DefaultPaths.defaultDictionaryPath);
     }
     else if (defaultValueSet == ConfigDataType.TempFolder)
     {
         Debug.LogWarning(WarningMessages.defaultTempFolderPathSet);
         return(DefaultPaths.defaultTempFolderPath);
     }
     else
     {
         return(string.Empty);
     }
 }
コード例 #8
0
        private void ReadIList(IList list, Type eleType, XElement[] eleEleArr, ConfigAttributeTypes configAttributeTypes)
        {
            ConfigDataType configDataType = this.GetDataType(eleType);
            string         value, eleName = null;
            object         obj;

            switch (configDataType)
            {
            case ConfigDataType.IDictionary:
                foreach (var eleEle in eleEleArr)
                {
                    obj = Activator.CreateInstance(eleType);
                    this.ReadIDictionary((IDictionary)obj, eleEle.Elements(eleName).ToArray(), eleType, configAttributeTypes);
                    list.Add(obj);
                }
                break;

            case ConfigDataType.IList:
                var itemType2 = this.GetIListElementType(eleType);
                eleName = this.GetIListElementName(itemType2);
                XElement[] eleEleArr2;
                foreach (var eleEle in eleEleArr)
                {
                    eleEleArr2 = eleEle.Elements(eleName).ToArray();
                    obj        = this.CreateIList(eleType, eleEleArr2.Length);
                    this.ReadIList((IList)obj, itemType2, eleEleArr2, configAttributeTypes);
                    list.Add(obj);
                }
                break;

            case ConfigDataType.Object:
                PropertyInfo[] objPropertyInfoArr = this.GetTypePropertyInfos(eleType);
                int            index = 0;
                foreach (var eleEle in eleEleArr)
                {
                    obj = Activator.CreateInstance(eleType);
                    this.ReadConfigToXml(eleEle, objPropertyInfoArr, ref obj, configAttributeTypes);
                    if (list is Array)
                    {
                        list[index++] = obj;
                    }
                    else
                    {
                        list.Add(obj);
                    }
                }
                break;

            case ConfigDataType.Basic:
                foreach (var eleEle in eleEleArr)
                {
                    value = XmlEx.GetXElementAttributeValue(eleEle, _VALUE, true);
                    list.Add(this.StringToObject(value, eleType));
                }
                break;

            default:
                throw new NotImplementedException(configDataType.ToString());
            }
        }
コード例 #9
0
 public DynamicCheckBox(ConfigDataType configDataType, string spellKey, string displayName, bool defaultValue,
                        bool isBasedOnSpell, SpellConfigProperty property)
 {
     _type     = configDataType;
     _spellKey = spellKey;
     DynamicCheckBoxInit(displayName, defaultValue, isBasedOnSpell, property);
 }
コード例 #10
0
 public DynamicCheckBox(ConfigDataType configDataType, string spellKey, string displayName, bool defaultValue,
     bool isBasedOnSpell, SpellConfigProperty property)
 {
     _type = configDataType;
     _spellKey = spellKey;
     DynamicCheckBoxInit(displayName, defaultValue, isBasedOnSpell, property);
 }
コード例 #11
0
 public DynamicSlider(ConfigDataType configDataType, string spelKey, string displayName, int defaultValue,
     int minValue, int maxValue, bool isBasedOnSpell, SpellConfigProperty property)
 {
     _type = configDataType;
     _spellKey = spelKey;
     DynamicSliderInit(displayName, defaultValue, minValue, maxValue, isBasedOnSpell, property);
 }
コード例 #12
0
 public DynamicSlider(ConfigDataType configDataType, string spelKey, string displayName, int defaultValue,
                      int minValue, int maxValue, bool isBasedOnSpell, SpellConfigProperty property)
 {
     _type     = configDataType;
     _spellKey = spelKey;
     DynamicSliderInit(displayName, defaultValue, minValue, maxValue, isBasedOnSpell, property);
 }
コード例 #13
0
 //删除某个类型的New的状态
 private void removeBag(BagOfStatus status)
 {
     if (status != null)
     {
         ConfigDataType type = DataCore.getDataType(status.num);
         removeBag(type, status.pid);
     }
 }
コード例 #14
0
 public DynamicComboBox(ConfigDataType type, ConfigValue key, string displayName, int defaultValue, string[] values)
 {
     _configKey                       = key;
     _type                            = type;
     ComboBox                         = new ComboBox(displayName, defaultValue, values);
     ComboBox.OnValueChange          += ComboBox_OnValueChange;
     Properties.OnConfigValueChanged += Properties_OnConfigValueChanged;
 }
コード例 #15
0
    void GetMarkAtlasAndSet(int m_pid, UISprite mItemIcon)
    {
        ConfigDataType datatype = DataCore.getDataType(m_pid);

        if (datatype == ConfigDataType.Monster)
        {
            AtlasMgr.mInstance.SetHeadSprite(mItemIcon, m_pid.ToString());
            return;
        }
        else if (datatype == ConfigDataType.Equip)
        {
            mItemIcon.atlas = AtlasMgr.mInstance.equipAtlas;
        }
        else if (datatype == ConfigDataType.Gems)
        {
            mItemIcon.atlas = AtlasMgr.mInstance.commonAtlas;
        }
        else if (datatype == ConfigDataType.Item)
        {
            mItemIcon.atlas = AtlasMgr.mInstance.itemAtlas;
        }
        else if (datatype == ConfigDataType.Frag)
        {
            SoulInfo info = new SoulInfo(0, m_pid, 1);
            Soul     soul = new Soul();
            soul.m_config = Core.Data.soulManager.GetSoulConfigByNum(info.num);
            soul.m_RTData = info;
            if (soul.m_config.type == (int)ItemType.Monster_Frage)
            {
                MonsterData mon = Core.Data.monManager.getMonsterByNum(soul.m_config.updateId);
                if (mon != null)
                {
                    AtlasMgr.mInstance.SetHeadSprite(mItemIcon, mon.ID.ToString());
                }
            }
            else if (soul.m_config.type == (int)ItemType.Equip_Frage)
            {
                EquipData equip = Core.Data.EquipManager.getEquipConfig(soul.m_config.updateId);
                if (equip != null)
                {
                    mItemIcon.atlas      = AtlasMgr.mInstance.equipAtlas;
                    mItemIcon.spriteName = soul.m_config.updateId.ToString();
                }
            }
            else
            {
                mItemIcon.atlas      = AtlasMgr.mInstance.itemAtlas;
                mItemIcon.spriteName = soul.m_RTData.num.ToString();
            }
            return;
        }
        ItemData _data = Core.Data.itemManager.getItemData(m_pid);

        if (_data != null)
        {
            mItemIcon.spriteName = _data.iconID.ToString();
        }
    }
コード例 #16
0
        private void WriteIList(string name, XElement collectionEle, IList list, Type eleType, ConfigAttributeTypes configAttributeTypes)
        {
            if (list == null || list.Count == 0)
            {
                return;
            }

            string         eleName = this.GetIListElementName(eleType), eleName2 = null;
            ConfigDataType configDataType = this.GetDataType(eleType);

            switch (configDataType)
            {
            case ConfigDataType.IDictionary:
                eleName2 = this.GetIDictionaryElementName(null);
                foreach (var item in list)
                {
                    this.WriteIDictionary(collectionEle, (IDictionary)item, eleType, eleName, eleName2, null, configAttributeTypes);
                }
                break;

            case ConfigDataType.IList:
                var itemType2 = this.GetIListElementType(eleType);
                eleName = this.GetIListElementName(itemType2);
                foreach (var item in list)
                {
                    XElement itemEle = new XElement(name);
                    collectionEle.Add(itemEle);
                    this.WriteIList(eleName, itemEle, (IList)item, itemType2, configAttributeTypes);
                }
                break;

            case ConfigDataType.Object:
                PropertyInfo[] objPropertyInfoArr = this.GetTypePropertyInfos(eleType);
                foreach (var item in list)
                {
                    if (item == null)
                    {
                        continue;
                    }

                    XElement childEle = new XElement(name);
                    this.WriteConfigToXml(childEle, objPropertyInfoArr, item, configAttributeTypes);
                    collectionEle.Add(childEle);
                }
                break;

            case ConfigDataType.Basic:
                foreach (var item in list)
                {
                    this.WriteItem(collectionEle, name, item, null);
                }
                break;

            default:
                throw new NotImplementedException(configDataType.ToString());
            }
        }
コード例 #17
0
    public void SetColumnInfo(object desc, object name, ConfigDataType dt)
    {
        string sName = (null == name) ? string.Empty : name.ToString().Trim();
        string sDesc = (null == desc) ? string.Empty : desc.ToString().Trim();

        ColDesc    = sDesc;
        ConfigName = sName;
        DataType   = dt;
        DefName    = sName;
    }
コード例 #18
0
    //根据类型获取New数量
    public int getStatusByType(ConfigDataType type)
    {
        int count = 0;

        if (!mDicBagStatus2.TryGetValue(type, out count))
        {
            count = 0;
        }
        return(count);
    }
コード例 #19
0
    //添加一个配置数据
    private void AddData(ConfigDataType type, ConfigDataCommon data)
    {
        if (allConfigData.ContainsKey(type))
        {
            Utils.LogSys.Log(type.ToString() + " is already exist");
            return;
        }

        allConfigData.Add(type, data);
    }
コード例 #20
0
 public void Init(int id)
 {
     curType = DataCore.getDataType(id);
     if (curType != ConfigDataType.Default_No)
     {
         if (curType == ConfigDataType.Monster)
         {
             spAtt.gameObject.SetActive(true);
             AtlasMgr.mInstance.SetHeadSprite(spHead, id.ToString());
             MonsterData mData = Core.Data.monManager.getMonsterByNum(id);
             if (mData != null)
             {
                 lblName.text = mData.name;
             }
             spAtt.spriteName = "Attribute_" + att.ToString();
             if (lv == 0)
             {
                 lblLevel.gameObject.SetActive(false);
             }
             else
             {
                 lblLevel.text = "Lv" + lv;
             }
             if (att == 0)
             {
                 spBorder.spriteName = "star1";
             }
             else
             {
                 spBorder.spriteName = "star" + att.ToString();
             }
             if (spKill != null)
             {
                 spKill.gameObject.SetActive(true);
             }
         }
         else if (curType == ConfigDataType.Skill)
         {
             spAtt.gameObject.SetActive(false);
             spKill.gameObject.SetActive(false);
             SkillData skData = Core.Data.skillManager.getSkillDataConfig(id);
             if (skData != null)
             {
                 spHead.atlas      = AtlasMgr.mInstance.skillAtlas;
                 spHead.spriteName = id.ToString();
                 spHead.MakePixelPerfect();
                 lblName.text  = skData.name;
                 lblLevel.text = skData.level;
             }
             spAtt.gameObject.SetActive(false);
             spBorder.spriteName = "star6";
         }
         spHead.MakePixelPerfect();
     }
 }
コード例 #21
0
ファイル: Define.cs プロジェクト: zhenghehe2014/u3dframework
    public static ColumnInfo CreateColumnInfo(object desc, object name, ConfigDataType dt)
    {
        ColumnInfo info = new ColumnInfo();
        string sName = null == name ? string.Empty : name.ToString().Trim();
        string sDesc = null == desc ? string.Empty : desc.ToString().Trim();

        info.ColDesc = sDesc;
        info.ConfigName = sName;
        info.DataType = dt;
        return info;
    }
コード例 #22
0
    void SetMoneyAndKeys()
    {
        ItemIcon[0].gameObject.SetActive(false);
        ItemIcon[1].gameObject.SetActive(false);
        ItemValue[0].SafeText("");
        ItemValue[1].SafeText("");
        if (mNewMapFinalTrial.Data.Reward.Count > 2)
        {
            return;
        }
        for (int i = 0; i < mNewMapFinalTrial.Data.Reward.Count; i++)
        {
            ItemIcon[i].gameObject.SetActive(true);
            ConfigDataType datatype = DataCore.getDataType(mNewMapFinalTrial.Data.Reward[i][0]);
            if (datatype == ConfigDataType.Monster)
            {
                AtlasMgr.mInstance.SetHeadSprite(ItemIcon[i], mNewMapFinalTrial.Data.Reward[i][0].ToString());
                continue;
            }
            else if (datatype == ConfigDataType.Equip)
            {
                ItemIcon[i].atlas = AtlasMgr.mInstance.equipAtlas;
            }
            else if (datatype == ConfigDataType.Gems)
            {
                ItemIcon[i].atlas = AtlasMgr.mInstance.commonAtlas;
            }
            else if (datatype == ConfigDataType.Item)
            {
                ItemIcon[i].atlas = AtlasMgr.mInstance.itemAtlas;
            }
            else if (datatype == ConfigDataType.Frag)
            {
                int id = (mNewMapFinalTrial.Data.Reward[i][0] % 150000) + 10000;
                if (DataCore.getDataType(id) == ConfigDataType.Monster)
                {
                    AtlasMgr.mInstance.SetHeadSprite(ItemIcon[i], id.ToString());
                    continue;
                }
                else if (DataCore.getDataType(id) == ConfigDataType.Item)
                {
                    ItemIcon[i].atlas = AtlasMgr.mInstance.itemAtlas;
                }
            }

            ItemIcon[i].spriteName = mNewMapFinalTrial.Data.Reward[i][0].ToString();
            StringBuilder builder = new StringBuilder("x");
            builder.Append(mNewMapFinalTrial.Data.Reward[i][1]);
            ItemValue[i].SafeText(builder.ToString());
        }
    }
コード例 #23
0
    /// <summary>
    /// 获取配置数据
    /// </summary>
    /// <param name="type">配置数据类型</param>
    /// <returns>配置数据类</returns>
    public ConfigDataCommon GetData(ConfigDataType type)
    {
        if (allConfigData == null)
        {
            return(null);
        }

        if (!allConfigData.ContainsKey(type))
        {
            LogSys.LogError("key don't exist " + type);
            return(null);
        }
        return(allConfigData[type]);
    }
コード例 #24
0
ファイル: SoulManager.cs プロジェクト: mengtest/DragonBallNew
 public void AddSoul(ItemOfReward[] p)
 {
     if (p != null)
     {
         foreach (ItemOfReward ior in p)
         {
             ConfigDataType type = ior.getCurType();
             if (ior != null && type == ConfigDataType.Frag)
             {
                 Soul soul = ior.toSoul(this);
                 AddSoul(soul);
             }
         }
     }
 }
コード例 #25
0
        public AddEditConfigDataModel(string archivePath, ConfigDataType type, T item)
        {
            ConfigData fileAccessor = new ConfigData();

            DataTemplate       = default;
            ValidTemplateBases = ConfigDataCache.GetAll <T>();
            Archives           = GetArchiveNames(fileAccessor, type, item.UniqueKey);

            ArchivePath = archivePath;

            if (!string.IsNullOrWhiteSpace(ArchivePath))
            {
                GetArchivedTemplate(fileAccessor, type, item);
            }
        }
コード例 #26
0
    //增加某个类型的New的状态
    public void analyseBag(ConfigDataType type, int pid)
    {
        //New status 的数量RefreshCount
        int count = 0;

        if (!mDicBagStatus2.TryGetValue(type, out count))
        {
            count = 0;
        }

        if (getStatus(pid) == BagOfStatus.STATUS_NEW)          //如果是New状态
        {
            count++;
        }
        mDicBagStatus2[type] = count;
    }
コード例 #27
0
    string GetRewardName(ItemOfReward reward)
    {
        string strName = "";

        if (reward.getCurType() == ConfigDataType.Monster)
        {
            Monster data = reward.toMonster(Core.Data.monManager);
            strName = data.config.name;
        }
        else if (reward.getCurType() == ConfigDataType.Equip)
        {
            Equipment data = reward.toEquipment(Core.Data.EquipManager, Core.Data.gemsManager);
            strName = data.ConfigEquip.name;
        }
        else if (reward.getCurType() == ConfigDataType.Gems)
        {
            Gems data = reward.toGem(Core.Data.gemsManager);
            strName = data.configData.name;
        }
        else if (reward.getCurType() == ConfigDataType.Frag)
        {
            Soul data = reward.toSoul(Core.Data.soulManager);
            strName = data.m_config.name;
        }
        else if (reward.getCurType() == ConfigDataType.Item)
        {
            ConfigDataType type = DataCore.getDataType(reward.pid);
            if (type == ConfigDataType.Item)
            {
                Item realItem = new Item();
                realItem.RtData     = new ItemInfo();
                realItem.RtData.num = reward.pid;
                realItem.configData = Core.Data.itemManager.getItemData(reward.pid);
                strName             = realItem.configData.name;
            }
            else if (type == ConfigDataType.Frag)
            {
                Soul soul = new Soul();
                soul.m_RTData       = new SoulInfo();
                soul.m_RTData.num   = reward.pid;
                soul.m_RTData.count = 1;
                soul.m_config       = Core.Data.soulManager.GetSoulConfigByNum(reward.pid);
                strName             = soul.m_config.name;
            }
        }
        return(strName);
    }
コード例 #28
0
    public void OpenTag(SecretShopType mType, int index)
    {
        string _name = "";
        string _dec  = "";

        if (mType != SecretShopType.SecretShopType_Dec)
        {
            if (m_data == null)
            {
                return;
            }
            ConfigDataType type = DataCore.getDataType(m_data.num);
            switch (type)
            {
            case ConfigDataType.Monster:
                _name = Core.Data.monManager.getMonsterByNum(m_data.num).name;
                _dec  = Core.Data.monManager.getMonsterByNum(m_data.num).description;
                break;

            case ConfigDataType.Item:
                _name = Core.Data.itemManager.getItemData(m_data.num).name;
                _dec  = Core.Data.itemManager.getItemData(m_data.num).description;
                break;

            case ConfigDataType.Equip:
                _name = Core.Data.EquipManager.getEquipConfig(m_data.num).name;
                _dec  = Core.Data.EquipManager.getEquipConfig(m_data.num).description;
                break;

            case ConfigDataType.Gems:
                _name = Core.Data.gemsManager.getGemData(m_data.num).name;
                _dec  = Core.Data.gemsManager.getGemData(m_data.num).description;
                break;

            case ConfigDataType.Frag:
                _name = Core.Data.soulManager.GetSoulConfigByNum(m_data.num).name;
                _dec  = Core.Data.soulManager.GetSoulConfigByNum(m_data.num).description;
                break;

            default:
                RED.LogError(" not found  : " + m_data.num);
                break;
            }
        }

        _UISecretShopTag.SetDetail(_name, _dec, m_data.money, m_data, index);
    }
コード例 #29
0
        /// <summary>
        /// 获取指定类型数据的集合 --- 已经加载的表数据应该缓存下来
        /// </summary>
        /// <typeparam name="T">数据对象类型</typeparam>
        /// <param name="t">数据表类型</param>
        /// <returns></returns>
        public Dictionary <string, T> GetDic <T>(ConfigDataType t) where T : BaseConfigData, new()
        {
            Dictionary <string, T> tDic = new Dictionary <string, T>();
            List <T> Tlist = new List <T>();
            Dictionary <string, object> dic;

            if (configData.TryGetValue((byte)t, out dic))
            {
                foreach (var key in dic.Keys)
                {
                    T tdata = new T();
                    tdata.Load(dic[key]);
                    tDic.Add(key, tdata);
                }
            }
            return(tDic);
        }
コード例 #30
0
    void AddRewardToBag(ItemOfReward item)
    {
        ConfigDataType type = DataCore.getDataType(item.pid);

        switch (type)
        {
        case ConfigDataType.Item:
        {
            Core.Data.itemManager.addItem(item);
            break;
        }

        case ConfigDataType.Monster:
        {
            Monster monster = item.toMonster(Core.Data.monManager);
            if (monster != null)
            {
                Core.Data.monManager.AddMonter(monster);
            }
            break;
        }

        case ConfigDataType.Equip:
        {
            Core.Data.EquipManager.AddEquip(item);
            break;
        }

        case ConfigDataType.Gems:
        {
            Core.Data.gemsManager.AddGems(item);
            break;
        }

        case ConfigDataType.Frag:
        {
            Soul soul = item.toSoul(Core.Data.soulManager);
            if (soul != null)
            {
                Core.Data.soulManager.AddSoul(soul);
            }
            break;
        }
        }
    }
コード例 #31
0
    /// <summary>
    /// Checks my fate. 只有在队伍里面的才有缘分的价值,同时还有奥义数据
    /// </summary>
    /// <returns><c>true</c>, if my fate was checked, <c>false</c> otherwise.</returns>
    /// <param name="faDa">Fa da.</param>
    /// <param name="team">Team.</param>
    public bool checkMyFate(FateData faDa, MonsterTeam mTeam, List <AoYi> usedTeam)
    {
        bool check = true;

        if (faDa != null && mTeam != null && usedTeam != null)
        {
            int count = faDa.CountOfCondition;
            for (int i = 0; i < count; ++i)
            {
                int[] condition = faDa.MyFate(i);
                if (condition != null)
                {
                    ConfigDataType conData = (ConfigDataType)condition[FateData.Type_Pos];
                    int            ID      = condition[FateData.Item_ID_Pos];
                    int            amount  = condition[FateData.Item_Count_Pos];

                    switch (conData)
                    {
                    case ConfigDataType.HugeBeast:
                        check = checkAoYi(ID, amount, usedTeam) && check;
                        break;

                    case ConfigDataType.Gender:
                        check = checkGender((short)ID, amount, mTeam) && check;
                        break;

                    case ConfigDataType.Monster:
                        check = checkMonster(ID, amount, mTeam) && check;
                        break;

                    case ConfigDataType.Star:
                        check = checkStar(ID, amount, mTeam) && check;
                        break;

                    case ConfigDataType.Equip:
                        check = checkEquip(ID, amount, mTeam) && check;
                        break;
                    }
                }
            }
        }

        return(check);
    }
コード例 #32
0
    bool checkMyFate(FateData faDa, MonsterTeamInfo mTeam, int capacity)
    {
        bool check = true;

        if (faDa != null && mTeam != null)
        {
            int count = faDa.CountOfCondition;
            for (int i = 0; i < count; ++i)
            {
                int[] condition = faDa.MyFate(i);
                if (condition != null)
                {
                    ConfigDataType conData = (ConfigDataType)condition[FateData.Type_Pos];
                    int            ID      = condition[FateData.Item_ID_Pos];
                    int            amount  = condition[FateData.Item_Count_Pos];

                    switch (conData)
                    {
                    case ConfigDataType.HugeBeast:
                        check = false;
                        break;

                    case ConfigDataType.Gender:
                        check = false;
                        break;

                    case ConfigDataType.Monster:
                        check = checkMonster(ID, amount, mTeam, capacity) && check;
                        break;

                    case ConfigDataType.Star:
                        check = false;
                        break;

                    case ConfigDataType.Equip:
                        check = checkEquip(ID, amount, capacity) && check;
                        break;
                    }
                }
            }
        }

        return(check);
    }
コード例 #33
0
 public static void OpenUI(object data, ConfigDataType type)
 {
     if (_mInstance == null)
     {
         Object prefab = PrefabLoader.loadFromPack("JC/LevelUpMsgBox");
         if (prefab != null)
         {
             GameObject obj = Instantiate(prefab) as GameObject;
             RED.TweenShowDialog(obj);
             RED.AddChild(obj, DBUIController.mDBUIInstance._TopRoot);
             _mInstance = obj.GetComponent <LevelUpMsgBox> ();
         }
     }
     else
     {
         RED.SetActive(true, _mInstance.gameObject);
     }
     _mInstance.Init(data, type);
 }
コード例 #34
0
ファイル: ItemManager.cs プロジェクト: mengtest/DragonBallNew
    public void addItem(ClientBTShaBuResponse resp)
    {
        if (resp != null && resp.data != null && resp.status != BaseResponse.ERROR)
        {
            if (resp.data.award != null)
            {
                foreach (ItemOfReward item in resp.data.award)
                {
                    ConfigDataType type = DataCore.getDataType(item.pid);
                    switch (type)
                    {
                    case ConfigDataType.Item:
                        Core.Data.itemManager.addItem(item);
                        break;

                    case ConfigDataType.Monster:
                        Monster monster = item.toMonster(Core.Data.monManager);
                        if (monster != null)
                        {
                            Core.Data.monManager.AddMonter(monster);
                        }
                        break;

                    case ConfigDataType.Equip:
                        Core.Data.EquipManager.AddEquip(item);
                        break;

                    case ConfigDataType.Gems:
                        Core.Data.gemsManager.AddGems(item);
                        break;

                    case ConfigDataType.Frag:
                        Soul soul = item.toSoul(Core.Data.soulManager);
                        if (soul != null)
                        {
                            Core.Data.soulManager.AddSoul(soul);
                        }
                        break;
                    }
                }
            }
        }
    }
コード例 #35
0
 public DynamicSlider(ConfigDataType configDataType, ConfigValue key, string displayName, int defaultValue, int minValue, int maxValue)
 {
     _type = configDataType;
     _configKey = key;
     DynamicSliderInit(displayName, defaultValue, minValue, maxValue, false, SpellConfigProperty.None);
 }
コード例 #36
0
 public DynamicCheckBox(ConfigDataType configDataType, ConfigValue key, string displayName, bool defaultValue)
 {
     _type = configDataType;
     _configKey = key;
     DynamicCheckBoxInit(displayName, defaultValue, false, SpellConfigProperty.None);
 }