Exemplo n.º 1
0
    protected override void OnViewPartLoaded()
    {
        m_Container   = FindComponent <Transform>("MODList");
        m_ModCellList = new List <WarshipModPanelElement>();

        UIManager.Instance.GetUIElement("Assets/Artwork/UI/Prefabs/Element/WarShipMessageElement.prefab",
                                        (cell) =>
        {
            m_ModTips = cell.Spawn(m_Container);
            m_ModTips.SetActive(false);
            m_ModTips.transform.localScale = Vector3.one;
        }
                                        );

        UIManager.Instance.GetUIElement("Assets/Artwork/UI/Prefabs/Element/WarShipModElement.prefab",
                                        (cell) =>
        {
            m_ModItemPrefab = cell;
        }
                                        );

        m_CurrentSelectedCell = null;
        OnRefresh(m_Msg);
        WarshipModPanel warshipModPanel = OwnerView as WarshipModPanel;

        warshipModPanel.OnEscClick = OnEscClick;
        State.GetAction(UIAction.Common_Select).Callback += OnModSelected;
        State.GetAction(UIAction.Common_Select).Enabled   = false;
        ShowCharacter();
    }
Exemplo n.º 2
0
    protected override void OnViewPartUnload()
    {
        WarshipModPanel warshipModPanel = OwnerView as WarshipModPanel;

        warshipModPanel.OnEscClick = null;
        State.GetAction(UIAction.Common_Select).Callback -= OnModSelected;
        for (int i = 0; i < m_ModCellList.Count; i++)
        {
            m_ModCellList[i].gameObject.Recycle();
        }
        m_ModTips.Recycle();
    }