Example #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());
    }
Example #2
0
    public override void OnShow(object msg)
    {
        base.OnShow(msg);

        LoadViewPart(ASSET_ADDRESS, OwnerView.ListBox);
        OwnerView.PageBox.gameObject.SetActive(false);
        m_WarshipDialogPanel             = OwnerView as WarshipDialogPanel;
        m_BeforeToggle                   = m_WarshipDialogPanel.BeforeToggle;
        m_CfgEternityProxy               = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        m_ShipProxy                      = GameFacade.Instance.RetrieveProxy(ProxyName.ShipProxy) as ShipProxy;
        m_PackageProxy                   = GameFacade.Instance.RetrieveProxy(ProxyName.PackageProxy) as PackageProxy;
        m_ServerListProxy                = GameFacade.Instance.RetrieveProxy(ProxyName.ServerListProxy) as ServerListProxy;
        m_SceneShipProxy                 = GameFacade.Instance.RetrieveProxy(ProxyName.SceneShipProxy) as SceneShipProxy;
        m_WarshipDialogPanel.AppointShip = m_ShipProxy.GetAppointWarShip();

        if (m_WarshipDialogPanel.LastShip != null)
        {
            if (m_ShipProxy.GetAppointWarShip().GetTID() != m_WarshipDialogPanel.LastShip.GetTID())
            {
                m_SceneShipProxy.HideShip();
                m_SceneShipProxy.ShowShip();
            }
        }
        m_WarshipDialogPanel.LastShip = m_ShipProxy.GetAppointWarShip();
        if (msg != null)
        {
            m_CurrentShip = msg as IShip;
        }
        else
        {
            m_CurrentShip = m_ShipProxy.GetAppointWarShip();
        }
        m_ShowAppiontIcon = true;
        if (m_WarshipDialogPanel.AppointShip.GetTID() != m_CurrentShip.GetTID())
        {
            m_ShowAppiontIcon = false;
        }
        if (m_CurrentShip == null)
        {
            return;
        }
        if (m_CurrentShip == null)
        {
            Debug.Log("没有战船");
            return;
        }

        m_Weapons = new IWeapon[m_CurrentShip.GetWeaponContainer().GetCurrentSizeMax()];
        IWeapon[] tempWeapons = m_CurrentShip.GetWeaponContainer().GetWeapons();
        if (tempWeapons != null)
        {
            for (int i = 0; i < tempWeapons.Length; i++)
            {
                m_Weapons[tempWeapons[i].GetPos()] = tempWeapons[i];
            }
            tempWeapons = null;
        }

        m_Equipment = new IEquipment[m_CurrentShip.GetEquipmentContainer().GetCurrentSizeMax()];
        IEquipment[] tempEquips = m_CurrentShip.GetEquipmentContainer().GetEquipments();
        if (tempEquips != null)
        {
            for (int i = 0; i < tempEquips.Length; i++)
            {
                m_Equipment[tempEquips[i].GetPos()] = tempEquips[i];
            }
            tempEquips = null;
        }

        m_Reformer = m_CurrentShip.GetReformerContainer().GetReformer();
    }