Esempio n. 1
0
    /// <summary>
    /// 進化画面更新
    /// </summary>
    public void updateEvolveStatus(bool bRenew = false, bool bMaterialReset = false)
    {
        if (bRenew)
        {
            //ユニットリスト作成
            makeUnitList();
            //ウインドウ閉じる
            m_ExpandWindow.Close(true);
            m_UnitGrid.changeGridWindowSize(false, (m_ExpandWindow != null) ? m_ExpandWindow.ViewHeightSize : 0);
            //パネルを消す
            m_UnitBGPanel.IsViewPanel = false;
            //ソートボタン有効化
            m_UnitGrid.IsActiveSortButton = true;
            //確認OFF
            m_Validate = false;
        }

        m_BaseUnit = UserDataAdmin.Instance.SearchChara(MainMenuParam.m_EvolveBaseUnitUniqueId);
        if (m_BaseUnit != null)
        {
            m_BaseCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_BaseUnit.id);

            //進化前アイコン
            m_UnitBGPanel.setupBaseUnit(m_BaseCharaMaster, m_BaseUnit);

            m_CharaEvol        = MasterDataUtil.GetCharaEvolParamFromCharaID(m_BaseUnit.id);
            m_AfterCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_CharaEvol.unit_id_after);

            //進化後アイコン
            m_UnitBGPanel.setupEvolveUnit(m_AfterCharaMaster, m_BaseUnit);
            //進化後名前
            m_UnitStatusPanel.setup(m_AfterCharaMaster, m_BaseUnit);

            //素材設定
            {
                //素材表示ON
                UnityUtil.SetObjectEnabledOnce(m_UnitMaterialPanel.gameObject, true);
                m_UnitMaterialPanel.MaterialList.Clear();
                m_UnitMaterialPanel.ObjectList.Clear();
                m_UnitMaterialPanel.PanelColor = Color.clear;
                int _materialCount = 0;
                //進化素材情報設定
                if (m_CharaEvol.unit_id_parts1 != 0)
                {
                    m_UnitMaterialPanel.addItem(_materialCount++, m_CharaEvol.unit_id_parts1, SelectMaterialUnit, true);
                }
                if (m_CharaEvol.unit_id_parts2 != 0)
                {
                    m_UnitMaterialPanel.addItem(_materialCount++, m_CharaEvol.unit_id_parts2, SelectMaterialUnit, true);
                }
                if (m_CharaEvol.unit_id_parts3 != 0)
                {
                    m_UnitMaterialPanel.addItem(_materialCount++, m_CharaEvol.unit_id_parts3, SelectMaterialUnit, true);
                }

                StartCoroutine(WaitSetMaterial());
            }

            //ボタン関連ON
            m_UnitBGPanel.IsViewExecButton   = true;
            m_UnitBGPanel.IsViewReturnButton = true;
            m_UnitBGPanel.ExecButtonImage    = m_ConfirmSprite;

            m_UnitBGPanel.IsActiveExecButton = IsEvolveStart();

            MainMenuHeader.UnderMsgRequest(GameTextUtil.GetText("un82p_description"));
        }
        else
        {
            //表示リセット
            m_UnitBGPanel.Money = 0;
            m_UnitBGPanel.resetBaseUnit();
            m_UnitBGPanel.resetEvolveUnit();
            m_UnitStatusPanel.reset();
            m_UnitMaterialPanel.MaterialList.Clear();

            //
            m_AfterCharaMaster = null;
            if (m_CharaEvol != null)
            {
                UnitIconImageProvider.Instance.Reset(m_CharaEvol.unit_id_parts1);
                UnitIconImageProvider.Instance.Reset(m_CharaEvol.unit_id_parts2);
                UnitIconImageProvider.Instance.Reset(m_CharaEvol.unit_id_parts3);

                m_CharaEvol = null;
            }

            //ボタン関連OFF
            m_UnitBGPanel.IsViewExecButton   = false;
            m_UnitBGPanel.IsViewReturnButton = false;

            if (bMaterialReset)
            {
                UnityUtil.SetObjectEnabledOnce(m_UnitMaterialPanel.gameObject, false);
            }
            else
            {
                StartCoroutine(WaitClearMaterial());
            }

            //ベース選択リスト更新
            updateBaseUnitList();
        }
    }
    /// <summary>
    /// 進化画面更新
    /// </summary>
    public void updateEvolveStatus(bool bRenew = false)
    {
        if (bRenew)
        {
            //ユニットリスト作成
            makeUnitList();
            //ウインドウ閉じる
            m_ExpandWindow.Close(true);
            m_UnitGrid.changeGridWindowSize(false, (m_ExpandWindow != null) ? m_ExpandWindow.ViewHeightSize : 0);
            //パネルを消す
            m_UnitBGPanel.IsViewPanel = false;
            //ソートボタン有効化
            m_UnitGrid.IsActiveSortButton = true;
            //確認OFF
            m_Validate = false;
        }

        if (m_UnitListCount <= 0)
        {
            if (m_MaxDialog == null)
            {
                m_MaxDialog = Dialog.Create(DialogType.DialogOK);
                m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.Title, "error_reject_common_title");
                m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.MainText, "unit_list_Unowned");
                m_MaxDialog.SetDialogTextFromTextkey(DialogTextType.OKText, "common_button1");
                m_MaxDialog.SetDialogEvent(DialogButtonEventType.OK, () =>
                {
                    MainMenuManager.Instance.AddSwitchRequest(MAINMENU_SEQ.SEQ_HOME_MENU, false, false);
                });
                m_MaxDialog.DisableCancelButton();
                m_MaxDialog.Show();
            }
        }

        m_BaseUnit = UserDataAdmin.Instance.SearchChara(MainMenuParam.m_EvolveBaseUnitUniqueId);
        if (m_BaseUnit != null)
        {
            m_BaseCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_BaseUnit.id);

            //進化前アイコン
            m_UnitBGPanel.setupBaseUnit(m_BaseCharaMaster, m_BaseUnit);

            m_CharaEvol        = MasterDataUtil.GetCharaEvolParamFromCharaID(m_BaseUnit.id);
            m_AfterCharaMaster = MasterFinder <MasterDataParamChara> .Instance.Find((int)m_CharaEvol.unit_id_after);

            //進化後アイコン
            m_UnitBGPanel.setupEvolveUnit(m_AfterCharaMaster, m_BaseUnit);
            //進化後名前
            m_UnitStatusPanel.setup(m_AfterCharaMaster, m_BaseUnit);

            //ボタン関連ON
            m_UnitBGPanel.IsViewExecButton   = true;
            m_UnitBGPanel.IsViewReturnButton = true;
            m_UnitBGPanel.ExecButtonImage    = m_ConfirmSprite;

            m_UnitBGPanel.IsActiveExecButton = IsEvolveStart();

            //ベース選択後リスト更新
            updateBaseUnitAfterList();

            SetupBlendAfterStatus();
        }
        else
        {
            //表示リセット
            m_UnitBGPanel.Point = 0;
            m_UnitBGPanel.resetBaseUnit();
            m_UnitBGPanel.resetEvolveUnit();
            m_UnitStatusPanel.reset();

            //ボタン関連OFF
            m_UnitBGPanel.IsViewExecButton   = false;
            m_UnitBGPanel.IsViewReturnButton = false;

            //ベース選択リスト更新
            updateBaseUnitList();
        }
    }