Exemplo n.º 1
0
    protected override void OnViewPartLoaded()
    {
        base.OnViewPartLoaded();
        RectTransform root = OwnerView.OtherBox.GetChild(0).GetComponent <RectTransform>();

        m_PointDic = new Dictionary <uint, StarPlantElement>();
        m_Title    = FindComponent <TMP_Text>(root, "Content/Title/Label_Title");
        //m_CanvasGroup = FindComponent<CanvasGroup>(root, "Content");
        m_AreaPointContainer = FindComponent <RectTransform>(root, "Content/MapList/Viewport/Content");
        m_StarImage          = FindComponent <RawImage>(root, "Content/StarImage").GetOrAddComponent <Starmap3DViewer>();

        m_Tweener = null;
        //m_CanvasGroup.alpha = 1;
        m_StarImage.enabled = false;

        State.GetAction(UIAction.Common_Select).Callback      += OnSelect;
        State.GetAction(UIAction.StarPlant_ToGalaxy).Callback += OnEsc;
        //State.GetAction(UIAction.StarMap_Close).Callback += OnCloseClick;
        OwnerView.AddHotKey(HotKeyID.StarmapOpen, OnCloseClick);

        OnRefresh();

        UIManager.Instance.ClosePanel(UIPanel.StarAreaPanel);
        UIManager.Instance.ClosePanel(UIPanel.StarGalaxyPanel);
    }
Exemplo n.º 2
0
 public override void InstallHotkey()
 {
     base.InstallHotkey();
     OwnerView.DeleteHotKey("NavLeft");
     OwnerView.DeleteHotKey("NavRight");
     OwnerView.AddHotKey("NavLeft", HotKeyID.NavLeft, OnQCallback);
     OwnerView.AddHotKey("NavRight", HotKeyID.NavRight, OnECallback);
 }
Exemplo n.º 3
0
 public override void OnShow(object msg)
 {
     base.OnShow(msg);
     LoadViewPart(ASSET_ADDRESS, OwnerView.ListBox);
     OwnerView.AddHotKey(HotKeyID.NavUp, UpOnClick);
     OwnerView.AddHotKey(HotKeyID.NavDown, DownOnClick);
     State.GetAction(UIAction.Agreement_Agree).Callback  += AgreeAgreement;
     State.GetAction(UIAction.Agreement_Reject).Callback += RejectAgreement;
     State.GetAction(UIAction.Agreement_Agree).Enabled    = false;
 }
Exemplo n.º 4
0
    /// <summary>
    /// 更新单个热键
    /// </summary>
    /// <param name="key"></param>
    private void UpdateHotkeyElement(UIViewAction key)
    {
        if (key.State < 0 || key.State >= key.StateList.Count)
        {
            return;
        }

        Transform outer  = OwnerView.State.GetActionBox();
        Transform parent = outer ? outer : FindComponent <Transform>("Content/HotkeyBox");

        UIViewActionState keyState = key.StateList[key.State];

        OwnerView.AddHotKey(key.ID, keyState.Hotkey, (callback) => { key.FireEvent(callback); }, keyState.Time, parent, keyState.Text);
        OwnerView.SetHotKeyVisible(key.ID, key.Visible);
        OwnerView.SetHotKeyEnabled(key.ID, key.Enabled);
        OwnerView.SetHotKeyDescription(key.ID, keyState.Text);
    }
Exemplo n.º 5
0
    protected override void OnViewPartLoaded()
    {
        base.OnViewPartLoaded();
        RectTransform root = OwnerView.OtherBox.GetChild(0).GetComponent <RectTransform>();

        m_PointDic           = new Dictionary <int, StarGalaxyElement>();
        m_Title              = FindComponent <TMP_Text>(root, "Content/Title/Label_Title");
        m_AreaPointContainer = FindComponent <RectTransform>(root, "Content/MapList/Viewport/Content");
        m_Scroller           = FindComponent <ScrollRect>(root, "Content/MapList");
        m_ScrollSensitivity  = m_Scroller.scrollSensitivity;

        InputManager.Instance.OnInputDeviceChanged       += OnInputDeviceChanged;
        State.GetAction(UIAction.Common_Select).Callback += OnSelect;
        State.GetAction(UIAction.Common_Back).Callback   += OnCloseClick;
        OwnerView.AddHotKey(HotKeyID.StarmapOpen, OnCloseClick);

        OnRefresh();

        UIManager.Instance.ClosePanel(UIPanel.StarAreaPanel);
        UIManager.Instance.ClosePanel(UIPanel.StarPlantPanel);
    }
Exemplo n.º 6
0
    protected override void OnViewPartLoaded()
    {
        base.OnViewPartLoaded();
        RectTransform root = OwnerView.OtherBox.GetChild(0).GetComponent <RectTransform>();

        m_Title                 = FindComponent <TMP_Text>(root, "Content/Title/Label_Title");
        m_LegendAnim            = FindComponent <Animator>(root, "Content");
        m_AreaPointContainer    = FindComponent <RectTransform>("Content/MapList/Viewport/Content");
        m_Starmap3DViewer       = FindComponent <RawImage>(root, "Back/Image_Ball").GetOrAddComponent <Starmap3DViewer>();
        m_StarAreaPanelLeftTips = FindComponent <Transform>(root, "Content/AreaMessage").gameObject.AddComponent <StarAreaPanelLeftTips>();
        m_StarAreaPanelLeftTips.Initialize(this);
        m_StarAreaPanelLeftTips.MissionSelected = SelectedMission;
        m_Scroller          = FindComponent <ScrollRect>(root, "Content/MapList");
        m_ScrollSensitivity = m_Scroller.scrollSensitivity;
        m_Scroller.onValueChanged.AddListener(OnMove);
        InitLegend();

        InputManager.Instance.OnInputDeviceChanged += OnInputDeviceChanged;

        //跃迁
        State.GetAction(UIAction.StarArea_Leap).Callback += OnLeap;
        State.GetAction(UIAction.StarArea_Leap).Enabled   = false;
        //任务追踪
        State.GetAction(UIAction.StarArea_TrackMission).Callback += OnTrackMission;
        //放弃任务
        State.GetAction(UIAction.StarArea_DropMission).Callback += OnDropMission;
        //切换左侧cell
        State.GetAction(UIAction.StarArea_TipsToggle).Callback += OnToggleTips;
        //上一级
        State.GetAction(UIAction.StarArea_ToPlant).Callback += OnEsc;
        //显示隐藏图例
        State.GetAction(UIAction.StarArea_Legend).Callback += OnTab;

        OwnerView.AddHotKey(HotKeyID.StarmapOpen, OnCloseClick);

        OnRefresh();

        UIManager.Instance.ClosePanel(UIPanel.StarGalaxyPanel);
        UIManager.Instance.ClosePanel(UIPanel.StarPlantPanel);
    }
Exemplo n.º 7
0
    /// <summary>
    /// 安装热键
    /// </summary>
    public virtual void InstallHotkey()
    {
        if (!GetTransform())
        {
            return;
        }
        OwnerView.DeleteHotKey("NavNegative");
        OwnerView.DeleteHotKey("NavPositive");
        //Q键
        Transform hotkeyQ = FindComponent <Transform>("Content/LImage");

        if (hotkeyQ)
        {
            OwnerView.AddHotKey("NavNegative", HotKeyID.NavNegative, OnQCallback, hotkeyQ, null, HotkeyManager.HotkeyStyle.UI_SIMPLE);
        }

        //E键
        Transform hotkeyE = FindComponent <Transform>("Content/RImage");

        if (hotkeyE)
        {
            OwnerView.AddHotKey("NavPositive", HotKeyID.NavPositive, OnECallback, hotkeyE, null, HotkeyManager.HotkeyStyle.UI_SIMPLE);
        }
    }