private void Setup(UnitData unit_data)
 {
     if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.m_TobiraStatusListItemTemplate, (UnityEngine.Object)null) || unit_data == null)
     {
         return;
     }
     ((Component)this.m_TobiraStatusListItemTemplate).get_gameObject().SetActive(false);
     TobiraParam[] array = ((IEnumerable <TobiraParam>)MonoSingleton <GameManager> .Instance.MasterParam.GetTobiraListForUnit(unit_data.UnitParam.iname)).Where <TobiraParam>((Func <TobiraParam, bool>)(tobiraParam => tobiraParam.TobiraCategory != TobiraParam.Category.START)).ToArray <TobiraParam>();
     for (int index = 0; index < array.Length; ++index)
     {
         TobiraData           tobiraData1 = unit_data.GetTobiraData(array[index].TobiraCategory);
         TobiraStatusListItem listItem    = this.CreateListItem();
         if (tobiraData1 != null)
         {
             listItem.SetTobiraLvIsMax(tobiraData1.IsMaxLv);
         }
         else
         {
             listItem.SetTobiraLvIsMax(false);
         }
         if (!array[index].Enable)
         {
             listItem.Setup(array[index]);
         }
         else
         {
             TobiraData tobiraData2 = new TobiraData();
             tobiraData2.Setup(unit_data.UnitParam.iname, array[index].TobiraCategory, (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.TobiraLvCap);
             listItem.Setup(tobiraData2);
         }
     }
 }
 public void Init(bool is_restore)
 {
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnitAttachTarget, (UnityEngine.Object)null) && !this.RefreshCurrentUnit())
     {
         return;
     }
     GlobalVars.SelectedEquipmentSlot.Set(-1);
     this.RefreshStatus();
     if (is_restore)
     {
         this.RefreshSelected();
         this.OnTobiraEnhanceBtn();
     }
     else if (this.mTobiraList.Count > 0)
     {
         TobiraParam.Category default_category = this.mTobiraList[0].Category;
         this.mSelectedTobiraCategory = default_category;
         GlobalVars.PreBattleUnitTobiraCategory.Set(default_category);
         this.mTobiraList.ForEach((Action <UnitTobiraItem>)(tobira => tobira.Select(tobira.Category == default_category)));
         this.mCurrentTobira = this.mCurrentUnit.TobiraData.Find((Predicate <TobiraData>)(tobira => tobira.Param.TobiraCategory == default_category));
         this.TobiraParamWindow.Refresh(this.mCurrentUnit, this.mCurrentTobira, this.mTobiraList[0].Param);
     }
     UnitEnhanceV3.Instance.RefreshTobiraBgAnimation(this.mCurrentTobira, true);
     UnitTobiraInventory.mInitTimeUniqueID = (long)GlobalVars.SelectedUnitUniqueID;
 }
 public void Setup(TobiraData tobiraData)
 {
     if (tobiraData == null)
     {
         DebugUtility.LogError("tobiraDataがnullの時はSetup(TobiraParam param)を使用してください");
     }
     else
     {
         this.m_Category = tobiraData.Param.TobiraCategory;
         this.m_TextTobiraName.set_text(TobiraParam.GetCategoryName(this.m_Category));
         this.m_IconTobira.ImageIndex = (int)this.m_Category;
         if (tobiraData.IsLearnedLeaderSkill)
         {
             TobiraLearnSkill listItem = this.CreateListItem();
             SkillData        skill    = new SkillData();
             skill.Setup(tobiraData.LearnedLeaderSkillIname, 1, 1, (MasterParam)null);
             listItem.Setup(skill);
         }
         List <AbilityData> newAbilitys = new List <AbilityData>();
         List <AbilityData> oldAbilitys = new List <AbilityData>();
         TobiraUtility.TryCraeteAbilityData(tobiraData.Param, tobiraData.Lv, newAbilitys, oldAbilitys, false);
         for (int index = 0; index < newAbilitys.Count; ++index)
         {
             this.CreateListItem().Setup(newAbilitys[index]);
         }
         BaseStatus add   = new BaseStatus();
         BaseStatus scale = new BaseStatus();
         TobiraUtility.CalcTobiraParameter(tobiraData.Param.UnitIname, this.m_Category, tobiraData.Lv, ref add, ref scale);
         this.m_StatusList.SetValues(add, scale, false);
         GameUtility.SetGameObjectActive(this.m_ObjectDetail, true);
         GameUtility.SetGameObjectActive(this.m_ObjectLock, false);
         GameUtility.SetGameObjectActive(this.m_ObjectCommingSoon, false);
     }
 }
Exemple #4
0
        public static string GetOverwriteLeaderSkill(List <TobiraData> list)
        {
            if (list.Count <= 0)
            {
                return(string.Empty);
            }
            TobiraData tobiraData = (TobiraData)null;

            using (List <TobiraData> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TobiraData current = enumerator.Current;
                    if (current.IsLearnedLeaderSkill)
                    {
                        tobiraData = tobiraData == null ? current : (tobiraData.Param.Priority >= current.Param.Priority ? tobiraData : current);
                    }
                }
            }
            if (tobiraData != null)
            {
                return(tobiraData.LearnedLeaderSkillIname);
            }
            return(string.Empty);
        }
Exemple #5
0
        public void Refresh(UnitData unitData, TobiraData tobiraData, TobiraParam tobiraParam)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.TobiraTitleText, (UnityEngine.Object)null))
            {
                return;
            }
            this.TobiraTitleText.set_text(TobiraParam.GetCategoryName(tobiraParam.TobiraCategory));
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AdditionalLevelCap, (UnityEngine.Object)null))
            {
                this.AdditionalLevelCap.set_text(MonoSingleton <GameManager> .Instance.MasterParam.FixParam.TobiraUnitLvCapBonus.ToString());
            }
            if (tobiraData == null)
            {
                this.TobiraParamIconEnable.SetActive(false);
                this.TobiraParamIconDisable.SetActive(true);
                Array.ForEach <UnitTobiraParamLevel>(this.TobiraParamIconLevels, (Action <UnitTobiraParamLevel>)(paramLevel => paramLevel.Refresh(0)));
                this.LockView(unitData, tobiraParam);
                this.mTobiraParameters.ForEach((Action <GameObject>)(paramGO => UnityEngine.Object.Destroy((UnityEngine.Object)paramGO)));
                this.mTobiraParameters.Clear();
                BaseStatus add   = new BaseStatus();
                BaseStatus scale = new BaseStatus();
                TobiraUtility.CalcTobiraParameter(unitData.UnitID, tobiraParam.TobiraCategory, 1, ref add, ref scale);
                this.Status.SetValues(add, scale, true);
                TobiraConditionParam[] conditionsForUnit = MonoSingleton <GameManager> .Instance.MasterParam.GetTobiraConditionsForUnit(unitData.UnitID, tobiraParam.TobiraCategory);

                this.CreateConditionsItems(unitData, conditionsForUnit);
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TobiraIcons, (UnityEngine.Object)null))
                {
                    this.TobiraIcons.ImageIndex = (int)tobiraData.Param.TobiraCategory;
                }
                this.TobiraParamIconEnable.SetActive(tobiraData.IsUnlocked);
                this.TobiraParamIconDisable.SetActive(!tobiraData.IsUnlocked);
                int level = tobiraData.ViewLv;
                Array.ForEach <UnitTobiraParamLevel>(this.TobiraParamIconLevels, (Action <UnitTobiraParamLevel>)(paramLevel => paramLevel.Refresh(level)));
                if (tobiraData.IsUnlocked)
                {
                    this.UnlockView(unitData, tobiraData);
                }
                else
                {
                    this.LockView(unitData, tobiraParam);
                }
                this.mTobiraParameters.ForEach((Action <GameObject>)(paramGO => UnityEngine.Object.Destroy((UnityEngine.Object)paramGO)));
                this.mTobiraParameters.Clear();
                BaseStatus add   = new BaseStatus();
                BaseStatus scale = new BaseStatus();
                TobiraUtility.CalcTobiraParameter(unitData.UnitID, tobiraData.Param.TobiraCategory, tobiraData.Lv, ref add, ref scale);
                this.Status.SetValues(add, scale, false);
                this.SetActiveConditionsItems(false);
            }
            this.SetMasterBonusText(tobiraParam);
        }
Exemple #6
0
        public static void CalcTobiraParameter(string unit_iname, TobiraParam.Category category, int lv, ref BaseStatus add, ref BaseStatus scale)
        {
            TobiraData tobiraData = new TobiraData();

            if (!tobiraData.Setup(unit_iname, category, lv))
            {
                return;
            }
            UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(unit_iname);

            SkillData.GetHomePassiveBuffStatus(tobiraData.ParameterBuffSkill, unitParam == null ? EElement.None : unitParam.element, ref add, ref scale);
        }
        public void Activated(int pinID)
        {
            switch (pinID)
            {
            case 0:
                this.RefreshAll();
                break;

            case 1:
                SerializeValueList currentValue = FlowNode_ButtonEvent.currentValue as SerializeValueList;
                if (currentValue == null)
                {
                    break;
                }
                UnitTobiraItem item = currentValue.GetComponent <UnitTobiraItem>("_self");
                if (UnityEngine.Object.op_Equality((UnityEngine.Object)item, (UnityEngine.Object)null))
                {
                    break;
                }
                this.mSelectedTobiraCategory = item.Category;
                GlobalVars.PreBattleUnitTobiraCategory.Set(this.mSelectedTobiraCategory);
                this.mCurrentTobira = this.mCurrentUnit.TobiraData.Find((Predicate <TobiraData>)(tobira => tobira.Param.TobiraCategory == item.Category));
                this.mTobiraList.ForEach((Action <UnitTobiraItem>)(tobira => tobira.Select(tobira.Category == item.Category)));
                this.TobiraParamWindow.Refresh(this.mCurrentUnit, this.mCurrentTobira, item.Param);
                UnitEnhanceV3.Instance.RefreshTobiraBgAnimation(this.mCurrentTobira, false);
                break;

            case 2:
                this.OnTobiraOpenBtn();
                break;

            case 3:
                this.OnTobiraEnhanceBtn();
                break;

            case 5:
                this.RefreshCurrentUnit();
                this.SuccessTobiraEnhance();
                break;

            case 6:
                this.RefreshCurrentUnit();
                this.SuccessTobiraOpen();
                break;

            case 7:
                UnitEnhanceV3.Instance.TobiraUIActive(false, false);
                break;
            }
        }
Exemple #8
0
        public void Refresh()
        {
            Button component = (Button)((Component)this).GetComponent <Button>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null) || this.mCategory <= TobiraParam.Category.START || TobiraParam.Category.MAX <= this.mCategory)
            {
                ((Component)this).get_gameObject().SetActive(false);
            }
            this.TobiraEnableImages.ImageIndex  = (int)(this.mCategory - 1);
            this.TobiraDisableImages.ImageIndex = (int)(this.mCategory - 1);
            this.mParam = MonoSingleton <GameManager> .Instance.MasterParam.GetTobiraParam(this.mUnit.UnitID, this.mCategory);

            if (this.mParam == null || !this.mParam.Enable)
            {
                ((Selectable)component).set_interactable(false);
                this.LockGO.SetActive(true);
            }
            else
            {
                TobiraData tobiraData = this.mUnit.TobiraData.Find((Predicate <TobiraData>)(tobira => tobira.Param.TobiraCategory == this.mCategory));
                bool       flag       = tobiraData != null && tobiraData.IsUnlocked;
                if (!flag)
                {
                    bool isEnable = TobiraUtility.IsClearAllToboraConditions(this.mUnit, this.mCategory);
                    this.DisableGO.SetActive(true);
                    this.SetHilightAnimationEnable(isEnable);
                    this.EnableGO.SetActive(false);
                }
                else
                {
                    this.DisableGO.SetActive(false);
                    this.SetHilightAnimationEnable(false);
                    this.EnableGO.SetActive(true);
                }
                if (this.LevelIconGOList == null || this.LevelIconGOList.Length == 0 || !flag)
                {
                    return;
                }
                for (int index = 0; index < this.LevelIconGOList.Length; ++index)
                {
                    if (!UnityEngine.Object.op_Equality((UnityEngine.Object) this.LevelIconGOList[index], (UnityEngine.Object)null))
                    {
                        this.LevelIconGOList[index].SetActive(index < tobiraData.ViewLv);
                    }
                }
            }
        }
Exemple #9
0
        public static List <TobiraData> CreateDummyData(UnitData unit)
        {
            TobiraParam[] tobiraListForUnit = MonoSingleton <GameManager> .Instance.MasterParam.GetTobiraListForUnit(unit.UnitParam.iname);

            List <TobiraData> tobiraDataList = new List <TobiraData>();

            for (int index = 0; index < tobiraListForUnit.Length; ++index)
            {
                if (tobiraListForUnit[index] != null)
                {
                    TobiraData tobiraData = new TobiraData();
                    tobiraData.Setup(tobiraListForUnit[index].UnitIname, tobiraListForUnit[index].TobiraCategory, index % 5 + 1);
                    tobiraDataList.Add(tobiraData);
                }
            }
            return(tobiraDataList);
        }
Exemple #10
0
 private void UnlockView(UnitData unitData, TobiraData tobiraData)
 {
     this.TobiraLevelUpButtonText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_INVENTORY_BTN_LV_UP"), (object)TobiraParam.GetCategoryName(tobiraData.Param.TobiraCategory)));
     this.TobiraLevelUpButton.SetActive(true);
     this.mLockedLayout.SetActive(!tobiraData.IsUnlocked);
     this.mTobiraConditionsLayout.SetActive(!tobiraData.IsUnlocked);
     this.mUnlockedLayout.SetActive(tobiraData.IsUnlocked);
     this.mTobiraMasterBonusLayout.SetActive(tobiraData.IsUnlocked);
     if (tobiraData.IsMaxLv)
     {
         this.TobiraLevelUpButton.SetActive(false);
         this.mTobiraMasterEbaleLayout.SetActive(true);
     }
     else
     {
         this.TobiraLevelUpButton.SetActive(true);
         this.mTobiraMasterEbaleLayout.SetActive(false);
         bool isEnable = TobiraUtility.IsClearAllToboraRecipe(unitData, tobiraData.Param.TobiraCategory, tobiraData.Lv);
         ((Selectable)this.TobiraOpenButton.GetComponent <Button>()).set_interactable(isEnable);
         UnitTobiraParamWindow.SetHilightAnimationEnable(this.TobiraLevelUpButton, isEnable);
     }
 }
 public ConditionsResult_TobiraLv(UnitData unitData, UnitParam unitParam, TobiraParam.Category condsTobiraCategory, int condsTobiraLv)
     : base(unitData, unitParam)
 {
     this.mCondsTobiraCategory = condsTobiraCategory;
     this.mCondsTobiraLv       = condsTobiraLv;
     this.mTargetValue         = condsTobiraLv;
     this.mTargetIsMaxLevel    = condsTobiraLv == (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.TobiraLvCap;
     if (unitData != null)
     {
         TobiraData tobiraData = unitData.GetTobiraData(this.mCondsTobiraCategory);
         if (tobiraData == null)
         {
             return;
         }
         this.mTobiraData   = tobiraData;
         this.mIsClear      = tobiraData.Lv >= this.mCondsTobiraLv;
         this.mCurrentValue = tobiraData.Lv;
     }
     else
     {
         this.mIsClear = false;
     }
 }
Exemple #12
0
 public void Initialize(UnitData unit, TobiraData tobira)
 {
     this.mCurrentUnit   = unit;
     this.mCurrentTobira = tobira;
 }
 private void RefreshSelected()
 {
     this.mCurrentTobira = this.mCurrentUnit.TobiraData.Find((Predicate <TobiraData>)(tobira => tobira.Param.TobiraCategory == (TobiraParam.Category)GlobalVars.PreBattleUnitTobiraCategory));
     this.mTobiraList.ForEach((Action <UnitTobiraItem>)(tobira => tobira.Select(tobira.Category == this.mCurrentTobira.Param.TobiraCategory)));
     this.TobiraParamWindow.Refresh(this.mCurrentUnit, this.mCurrentTobira, this.mCurrentTobira.Param);
 }