protected override void PageSwitchSetting(bool initalize)
    {
        base.PageSwitchSetting(initalize);

        //ページ初期化処理
        if (m_UnitBGPanel == null)
        {
            m_UnitBGPanel = m_CanvasObj.GetComponentInChildren <UnitBGPanel>();
            m_UnitBGPanel.SetPositionAjustStatusBar(new Vector2(0, 40), new Vector2(0, -345));
            m_UnitBGPanel.IsViewPointEvolve  = true;
            m_UnitBGPanel.IsViewEvolve       = true;
            m_UnitBGPanel.IsViewResetButton  = false;
            m_UnitBGPanel.IsViewExecButton   = false;
            m_UnitBGPanel.IsViewReturnButton = false;
            m_UnitBGPanel.Title        = GameTextUtil.GetText("unit_function_evolve");
            m_UnitBGPanel.TotalTitle   = GameTextUtil.GetText("unit_function_point");
            m_UnitBGPanel.Evolve_arrow = GameTextUtil.GetText("unit_function_evolve_arrow");
            m_UnitBGPanel.TotalPoint   = (int)UserDataAdmin.Instance.m_StructPlayer.have_unit_point;

            m_UnitBGPanel.DidSelect                    = SelectEvolve;
            m_UnitBGPanel.DidReturn                    = SelectReturn;
            m_UnitBGPanel.DidSelectIcon                = SelectUnitIcon;
            m_UnitBGPanel.DidSelectEvolveIcon          = SelectEvolveUnitIcon;
            m_UnitBGPanel.DidSelectEvolveIconLongpress = SelectEvolveUnitIcon;
        }
        if (m_ExpandWindow == null)
        {
            m_ExpandWindow = m_CanvasObj.GetComponentInChildren <ExpandWindow>();
            m_ExpandWindow.SetPositionAjustStatusBar(new Vector2(0, -232));
            m_ExpandWindow.ViewHeightSize  = 210.0f;
            m_ExpandWindow.DidSelectButton = SelectWindowButton;
        }

        if (m_UnitStatusPanel == null)
        {
            m_UnitStatusPanel = m_CanvasObj.GetComponentInChildren <UnitStatusPanel>();
            if (m_ExpandWindow != null)
            {
                m_UnitStatusPanel.SetParent(m_ExpandWindow.Content);
            }
        }

        if (m_UnitGrid == null)
        {
            //ユニットグリッド取得
            m_UnitGrid = m_CanvasObj.GetComponentInChildren <UnitGridComplex>();
            //サイズ設定
            m_UnitGrid.SetPositionAjustStatusBar(new Vector2(0, -35), new Vector2(-48, -315));

            m_UnitGrid.AttchUnitGrid <UnitGridView>(UnitGridView.Create());
        }

        updateEvolveStatus(true);

        MainMenuManager.Instance.currentCategory = MAINMENU_CATEGORY.UNIT;
    }
示例#2
0
    protected override void PageSwitchSetting(bool initalize)
    {
        base.PageSwitchSetting(initalize);

        if (m_UnitBGPanel == null)
        {
            m_UnitBGPanel = m_CanvasObj.GetComponentInChildren <UnitBGPanel>();
            m_UnitBGPanel.SetPositionAjustStatusBar(new Vector2(0, 40), new Vector2(0, -345));
            m_UnitBGPanel.IsViewIcon         = false;
            m_UnitBGPanel.IsViewSale         = true;
            m_UnitBGPanel.IsViewResetButton  = false;
            m_UnitBGPanel.IsViewExecButton   = true;
            m_UnitBGPanel.ExecButtonImage    = ResourceManager.Instance.Load("confirm_button");
            m_UnitBGPanel.IsViewReturnButton = false;
            m_UnitBGPanel.IsViewResetButton  = true;
            m_UnitBGPanel.Title          = GameTextUtil.GetText("unit_function_sell");
            m_UnitBGPanel.IsDetailButton = true;


            m_UnitBGPanel.SaleCountMax = MAX_SALE_UNIT_COUNT;

            m_UnitBGPanel.DidReset            = SelectReset;
            m_UnitBGPanel.DidSelect           = OpenSaleDialog;
            m_UnitBGPanel.DidReturn           = SelectReturn;
            m_UnitBGPanel.OnClickDetailAction = OnDetailWindow;
        }
        if (m_ExpandWindow == null)
        {
            m_ExpandWindow = m_CanvasObj.GetComponentInChildren <ExpandWindow>();
            m_ExpandWindow.SetPositionAjustStatusBar(new Vector2(0, -232));
            m_ExpandWindow.ViewHeightSize  = 182.0f;
            m_ExpandWindow.DidSelectButton = SelectWindowButton;
        }

        if (m_UnitSale == null)
        {
            m_UnitSale = m_CanvasObj.GetComponentInChildren <UnitSaleList>();
            for (int i = 0; i < MAX_SALE_UNIT_COUNT; i++)
            {
                m_UnitSale.addItem(i, 0);
            }

            if (m_ExpandWindow != null)
            {
                m_UnitSale.SetParent(m_ExpandWindow.Content);
            }
        }

        if (m_UnitGrid == null)
        {
            //ユニットグリッド取得
            m_UnitGrid = m_CanvasObj.GetComponentInChildren <UnitGridComplex>();
            //サイズ設定
            m_UnitGrid.SetPositionAjustStatusBar(new Vector2(0, -35), new Vector2(-48, -315));

            m_UnitGrid.AttchUnitGrid <UnitGridView>(UnitGridView.Create());
        }

        m_Validate = false;
        m_ExpandWindow.Close(true);
        m_UnitBGPanel.IsViewReturnButton = false;
        m_UnitBGPanel.IsViewPanel        = false;
        m_UnitBGPanel.ExecButtonImage    = ResourceManager.Instance.Load("confirm_button");
        m_UnitBGPanel.IsActiveExecButton = false;
        m_UnitGrid.IsActiveSortButton    = true;

        //
        resetSaleUnit();

        //ユニット情報構築
        updateUnitList();

        //
        SetupSaleStatusValue();

        MainMenuManager.Instance.currentCategory = MAINMENU_CATEGORY.UNIT;
    }