コード例 #1
0
    /// <summary>
    /// 加载模型
    /// </summary>
    /// <param name="target"></param>
    private void LoadViewerModel(SpacecraftEntity target)
    {
        if (m_NearestTarget != target)
        {
            m_NearestTarget = target;
            if (m_NearestTarget)
            {
                m_TargetList.Clear();
                if (m_NearestTarget.m_EntityFatherOwnerID == 0 && m_NearestTarget.HeroGroupId == 0)
                {
                    m_TargetViewer.LoadModel(ASSET_UI3DShip, FindSingleMine(), ASSET_UI3DEffect);
                }
                else
                {
                    m_TargetViewer.LoadModel(ASSET_UI3DShip, FindSubsidiaryMine(), ASSET_UI3DEffect);
                }

                if (!m_NearestTargetLast)
                {
                    PlaySound(WwiseMusicSpecialType.SpecialType_Voice_minera_event1);
                }
            }
            else
            {
                m_TargetViewer.ClearModel();
            }

            if (m_NearestTargetLast && m_NearestTargetLast.GetAttribute(AttributeName.kHP) <= 0)
            {
                PlaySound(WwiseMusicSpecialType.SpecialType_Voice_minera_event2);
            }
            m_NearestTargetLast = m_NearestTarget;
        }
    }
コード例 #2
0
    /// <summary>
    /// 显示角色模型
    /// </summary>
    public void ShowCharacter()
    {
        int tid = m_ServerListProxy.GetCurrentCharacterVO().Tid;

        if (m_CfgEternityProxy.GetPlayerByItemTId(tid) != null)
        {
            Model          m_Model       = m_CfgEternityProxy.GetItemModelByKey((uint)tid);
            Effect3DViewer m_npc3DViewer = m_CharacterModel.GetOrAddComponent <Effect3DViewer>();
            if (m_npc3DViewer != null)
            {
                m_npc3DViewer.ClearModel();
                m_npc3DViewer.LoadModel
                    (AssetAddressKey.PRELOADUI_UI3D_ESCCHARACTERPANEL,
                    m_Model.AssetName,
                    AssetAddressKey.FX_UI_CHARACTER_SCANNING,
                    GetNpcPos(m_Model),
                    GetNpcRotation(m_Model),
                    GetNpcScale(m_Model));
            }
        }
        else
        {
            Debug.Log("tid错误" + tid);
        }
    }
コード例 #3
0
    /// <summary>
    /// 部件卸载时
    /// </summary>
    protected override void OnViewPartUnload()
    {
        OwnerView.State.OnModelInfoChanged -= OnModelInfoChanged;

        if (m_3DViewer)
        {
            m_3DViewer.ClearModel();
            m_3DViewer = null;
        }
    }
コード例 #4
0
    /// <summary>
    /// 显示模型
    /// </summary>
    public void ShowModel()
    {
        CfgEternityProxy m_CfgEternityProxy = GameFacade.Instance.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        Effect3DViewer   m_Model3DViewer    = m_Model.GetOrAddComponent <Effect3DViewer>();
        UiModel          m_UiModel          = m_CfgEternityProxy.GetUiModel("Esc_1002");

        if (m_Model3DViewer != null)
        {
            //m_Model3DViewer.AutoAdjustBestRotationAndDistance = true;
            m_Model3DViewer.ClearModel();
            m_Model3DViewer.LoadModel
                (m_UiModel.Light, m_UiModel.ModelName,
                m_CfgEternityProxy.GetUiModelPos(m_UiModel), m_CfgEternityProxy.GetUiModelRotation(m_UiModel), m_CfgEternityProxy.GetUiModelScale(m_UiModel));
        }
    }
コード例 #5
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);
        }
    }
コード例 #6
0
 protected override void OnViewPartUnload()
 {
     m_ShipViewer.ClearModel();
 }