Esempio n. 1
0
    public override void Execute(INotification notification)
    {
        CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        ShipItemsProxy   shipItemsProxy   = GameFacade.Instance.RetrieveProxy(ProxyName.ShipItemsProxy) as ShipItemsProxy;

        shipItemsProxy.ClearShipItems();

        SceneShipProxy sceneShipProxy = GameFacade.Instance.RetrieveProxy(ProxyName.SceneShipProxy) as SceneShipProxy;

        if (cfgEternityProxy.GetMapByKey(cfgEternityProxy.GetCurrentGamingMapId()).Value.GamingType == 2)
        {
            sceneShipProxy.ShowShip();
        }
        else
        {
            sceneShipProxy.HideShip();
        }

        //设置输入模式
        InputManager.Instance.SceneInputMap = cfgEternityProxy.IsSpace() ? HotKeyMapID.SHIP : HotKeyMapID.HUMAN;

        //设置HUD
        if (cfgEternityProxy.IsSpace())
        {
            OpenHudByShip();
        }
        else
        {
            OpenHudByHuman();
            //进入手表升级场景打开屏蔽hud
            if ((uint)notification.Body == 1100)
            {
                UIManager.Instance.OpenPanel(UIPanel.HudBlockKeyPanel);
            }
            else
            {
                UIManager.Instance.ClosePanel(UIPanel.HudBlockKeyPanel);
            }
        }

        //音效场景切换背景音乐
        WwiseManager.Instance.SceneSwitchEnd(cfgEternityProxy.GetCurrentGamingMapId());
    }
Esempio n. 2
0
    /// <summary>
    /// 返回是否可播普通的预警||战斗
    /// </summary>
    /// <returns></returns>
    private bool CanPalyNormalBattle()
    {
        uint gamingMapId = m_CfgEternityProxy.GetCurrentGamingMapId();
        int  mapType     = m_CfgEternityProxy.GetMapByKey(gamingMapId).Value.GamingType;

        /// 根据地图类型过滤
        if (mapType == (int)KMapType.mapTeam)
        {
            return(false);
        }
        return(true);
    }
Esempio n. 3
0
    public void OnRefresh()
    {
        if (m_Data != null)
        {
            m_StarImage.SetModel(m_Data.fixedStarRes, Vector3.zero, Vector3.zero, Vector3.one);
            m_MissionTrackings = m_TaskTrackingProxy.GetAllTrackings();
            m_TeamMembers      = m_TeamProxy.GetMembersList();

            if (m_BeforeID == 0)
            {
                m_BeforeID = m_CfgEternityProxy.GetCurrentGamingMapId();
            }
            DrawMap(m_CfgEternityProxy.GetCurrentGamingMapId(), m_BeforeID);

            if (m_CurrentPoint)
            {
                OwnerView.FocusTo(m_CurrentPoint.gameObject);
            }
            m_Title.text = TableUtil.GetLanguageString($"starmap_name_{m_Data.fixedStarId}");
        }
    }
Esempio n. 4
0
    private void OnStarmapOpen(HotkeyCallback callback)
    {
        if (callback.performed)
        {
            CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;

            uint        gamingMapId = cfgEternityProxy.GetCurrentGamingMapId();
            int         mapType     = cfgEternityProxy.GetMapByKey(gamingMapId).Value.GamingType;
            UIPanelBase current     = UIManager.Instance.FocusPanel;
            if (current == null && mapType == 4)
            {
                UIManager.Instance.OpenPanel(UIPanel.StarAreaPanel);
            }
        }
    }
Esempio n. 5
0
    private void SetCurrentCell(StarAreaElement cell, float duration = 0.5f)
    {
        if (m_CurrentCell)
        {
            m_CurrentCell.SetToggleIsOn(false);
        }
        m_CurrentCell = cell;
        m_CurrentCell.SetToggleIsOn(true);
        m_AutoMoveing = true;
        m_AreaPointContainer.DOLocalMove(-m_CurrentCell.transform.localPosition, 0.5f).SetEase(Ease.OutExpo).OnComplete(() => { m_AutoMoveing = false; });

        m_StarAreaPanelLeftTips.SetData(m_Data.gamingmapId, m_CurrentCell.GetData(), m_MissionTrackings, m_TeamMembers);

        State.GetAction(UIAction.StarArea_TipsToggle).Enabled = m_StarAreaPanelLeftTips.HasToggle();
        State.GetAction(UIAction.StarArea_Leap).Enabled       = m_Data.gamingmapId == m_CfgEternityProxy.GetCurrentGamingMapId() && m_CurrentCell.GetData().areaId != MapManager.GetInstance().GetCurrentAreaUid();
    }
Esempio n. 6
0
    void OnSwitchMapLoadingPanelShown()
    {
        uint MapId = (GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy).GetCurrentMapId();

        // before loading
        Map.MapManager.GetInstance().TryChangeMap(MapId, () =>
        {
            // after loading
            CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
            uint lastGamingMapId = cfgEternityProxy.GetLastGamingMapId();
            uint gamingMapId     = cfgEternityProxy.GetCurrentGamingMapId();
            if (lastGamingMapId != Map.Constants.NOTSET_MAP_UID)
            {
                int lastMapType = cfgEternityProxy.GetMapByKey(lastGamingMapId).Value.GamingType;
                int mapType     = cfgEternityProxy.GetMapByKey(gamingMapId).Value.GamingType;
                if (lastMapType == 4 && mapType == 4)
                {
                    WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_EndCrossingTheGate, WwiseMusicPalce.Palce_1st, false, null);
                }
                else if (lastMapType == 4 && mapType == 2)
                {
                    WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_From_DeepSpaceToSpaceStation, WwiseMusicPalce.Palce_1st, false, null);
                }
                else if (lastMapType == 2 && mapType == 4)
                {
                    WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_From_SpaceStationToDeepSpace, WwiseMusicPalce.Palce_1st, false, null);
                }
            }

            Scene gameMainScene = SceneManager.GetSceneByName("GameMain");
            if (gameMainScene == null)
            {
                throw new System.Exception("not find scene 'GameMain'");
            }

            GameplayManager.Instance.SwitchMap(gameMainScene);
            GameFacade.Instance.SendNotification(NotificationName.MSG_SWITCH_SCENE_END, MapId);
        });
    }
Esempio n. 7
0
    public void SwtichMap(ulong areaId, Vector3 worldPos)
    {
        StateChangeHandler.HandleChangeState();
        DropHandler.HandleSyncDrop();
        SkillBroadCastRPCNet.Handle();

        LoadingPanelParamere loadingPanelParamere = MessageSingleton.Get <LoadingPanelParamere>();

        loadingPanelParamere.OnShown = () =>
        {
            GameplayProxy gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
            if (gameplayProxy != null)
            {
                GameplayManager.Instance.Clear();
                gameplayProxy.SetCurrentAreaUid(areaId);
                Vector3 gameWorldPos = gameplayProxy.WorldPositionToServerAreaOffsetPosition(worldPos);
                Map.MapManager.GetInstance().SetPlayerPosition(worldPos, gameWorldPos);
            }
            OnSwitchMapLoadingPanelShown();
        };
        UIManager.Instance.OpenPanel(UIPanel.LoadingSecondPanel, loadingPanelParamere);

        CfgEternityProxy cfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        uint             lastGamingMapId  = cfgEternityProxy.GetLastGamingMapId();
        uint             gamingMapId      = cfgEternityProxy.GetCurrentGamingMapId();

        if (lastGamingMapId != Map.Constants.NOTSET_MAP_UID)
        {
            int lastMapType = cfgEternityProxy.GetMapByKey(lastGamingMapId).Value.GamingType;
            int mapType     = cfgEternityProxy.GetMapByKey(gamingMapId).Value.GamingType;
            if (lastMapType == 4 && mapType == 4)
            {
                WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_StartCrossingTheGate, WwiseMusicPalce.Palce_1st, false, null);
            }
        }
    }
Esempio n. 8
0
    /// <summary>
    /// 重建所有跳点
    /// </summary>
    private void ResetJumpPoints()
    {
        CfgEternityProxy      eternityProxy     = Facade.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        GameLocalizationProxy localizationProxy = Facade.RetrieveProxy(ProxyName.GameLocalizationProxy) as GameLocalizationProxy;

        m_LeapCfgs.Clear();

        int index = 0;

        Eternity.FlatBuffer.Map map = eternityProxy.GetCurrentMapData();
        for (int i = 0; i < map.AreaListLength; i++)
        {
            Eternity.FlatBuffer.Area area = map.AreaList(i).Value;
            for (int j = 0; j < area.LeapListLength; j++)
            {
                LeapItem leapVO = area.LeapList(j).Value;

                m_LeapCfgs.Add(leapVO);

                if (index >= m_PointBox.childCount)
                {
                    Object.Instantiate(m_PointTemplate, m_PointBox);
                }

                if (index >= m_ArrowBox.childCount)
                {
                    Object.Instantiate(m_ArrowTemplate, m_ArrowBox);
                }

                Transform leapPointItem = m_PointBox.GetChild(index);
                Image     icon          = leapPointItem.Find("Icon/Image_Icon").GetComponent <Image>();
                TMP_Text  nameField1    = leapPointItem.Find("JumpTips/TextBox/Name").GetComponent <TMP_Text>();
                TMP_Text  distanceField = leapPointItem.Find("JumpTips/TextBox/Distance").GetComponent <TMP_Text>();

                Transform leapPointArrow = m_ArrowBox.GetChild(index);
                Image     arrowIcon      = FindComponent <Image>(leapPointArrow, "Icon");

                if (leapVO.IconConfId == 0)
                {
                    UIUtil.SetIconImage(icon, 31320);

                    arrowIcon.gameObject.SetActive(false);
                }
                else
                {
                    UIUtil.SetIconImage(icon, leapVO.IconConfId);

                    arrowIcon.gameObject.SetActive(true);
                    UIUtil.SetIconImage(arrowIcon, leapVO.IconConfId);
                }

                nameField1.text    = localizationProxy.GetString("leap_name_" + eternityProxy.GetCurrentGamingMapId() + "_" + leapVO.LeapId);
                distanceField.text = "";

                //Debug.LogError("LeapType : "+leapVO.LeapType+", LeapID : " + leapVO.LeapId + " , MainLeapId : " + leapVO.MainLeapId + ", Name : " + nameField1.text + ", VisibleLeapList[" + string.Join(",", leapVO.GetVisibleLeapListArray()) + "]");

                index++;
            }
        }

        for (int i = m_PointBox.childCount - 1; i >= index; i--)
        {
            m_PointBox.GetChild(i).gameObject.SetActive(false);
        }

        for (int i = m_ArrowBox.childCount - 1; i >= index; i--)
        {
            m_ArrowBox.GetChild(i).gameObject.SetActive(false);
        }
    }