Ejemplo n.º 1
0
    protected override int Compare(UIViewSortKind kind, object a, object b)
    {
        int result = 0;

        left  = a as IShip;
        right = b as IShip;
        switch (kind)
        {
        case UIViewSortKind.GetTime:
            result = (int)(right.GetCreatTime() - left.GetCreatTime());
            break;

        default:
            return(base.Compare(kind, left.GetBaseConfig(), right.GetBaseConfig()));
        }
        if (result == 0)
        {
            result = right.GetBaseConfig().Order - left.GetBaseConfig().Order;
        }
        if (result == 0)
        {
            result = (int)(right.GetBaseConfig().Id - left.GetBaseConfig().Id);
        }
        return(result);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 设置模型图
 /// </summary>
 private void SendViewerChange()
 {
     if (m_CurrentShip != null)
     {
         Msg3DViewerInfo viewerInfo = MessageSingleton.Get <Msg3DViewerInfo>();
         Model           model      = m_CfgEternityProxy.GetModel(m_CurrentShip.GetBaseConfig().Model);
         viewerInfo.Model    = model;
         viewerInfo.IsShip   = true;
         viewerInfo.position = new Vector3(-271.7f, -53.3f, 0);
         viewerInfo.size     = new Vector2(1775, 1209);
         GameFacade.Instance.SendNotification(NotificationName.MSG_3DVIEWER_CHANGE, viewerInfo);
     }
 }
Ejemplo n.º 3
0
    /// <summary>
    /// 显示模型
    /// </summary>
    public void ShowModel()
    {
        CfgEternityProxy m_CfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        ShipProxy        m_ShipProxy        = GameFacade.Instance.RetrieveProxy(ProxyName.ShipProxy) as ShipProxy;
        IShip            m_Ship             = m_ShipProxy.GetAppointWarShip();
        Effect3DViewer   m_Model3DViewer    = m_Model.GetOrAddComponent <Effect3DViewer>();
        Model            m_UiModel          = m_CfgEternityProxy.GetModel((int)m_Ship.GetBaseConfig().Model);

        if (m_Model3DViewer != null)
        {
            m_Model3DViewer.AutoAdjustBestRotationAndDistance = true;
            m_Model3DViewer.ClearModel();
            m_Model3DViewer.LoadModel
                (AssetAddressKey.PRELOADUI_UI3DSHIP, m_UiModel.AssetName);
        }
    }
Ejemplo n.º 4
0
    /// <summary>
    /// 设置模型图
    /// </summary>
    private void SendViewerChange()
    {
        Msg3DViewerInfo viewerInfo = MessageSingleton.Get <Msg3DViewerInfo>();
        Model           model;

        if (m_CurrentState == WarshipPanelState.ModMainShip)
        {
            model               = m_CfgEternityProxy.GetModel(m_CurrentShip.GetBaseConfig().Model);
            viewerInfo.IsShip   = true;
            viewerInfo.position = new Vector3(-49.8f, -89.7f, 0);
            viewerInfo.size     = new Vector2(1987, 1416);
        }
        else
        {
            //暂时没有武器
            model               = m_CfgEternityProxy.GetModel(m_CurrentWeapon.GetBaseConfig().Model);
            viewerInfo.IsShip   = false;
            viewerInfo.position = new Vector3(-49.8f, -89.7f, 0);
            viewerInfo.size     = new Vector2(1987, 1416);
        }
        viewerInfo.Model = model;

        GameFacade.Instance.SendNotification(NotificationName.MSG_3DVIEWER_CHANGE, viewerInfo);
    }