mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0
  • 指南
  • API 文档
  • 指南

    Show / Hide Table of Contents

    在大型项目中使用MRTK

    这个页面包含了一些有用的提示,可以帮助MRTK的使用者将其拉入现有的大型项目,或者建立一些新的东西,这些东西将是源码控制的,并且有多个 开发人员。

    我们建议阅读下面的所有指南,遵循它们将有助于避免在处理较大的代码库时遇到的一些棘手问题

    gitignore

    以下.gitignore文件是在使用MRTK时推荐使用的基础文件 MRTK中创建本地状态的部分可以被源代码控制安全地忽略 否则会破坏本地git状态。

    注意,这部分的开始部分是从默认的github Unity .gitignore具有后添加的MRTK-specific所提取的。还要注意,其中一些规则假定了某些路径 可以根据MRTK在项目中的位置进行修改。

    # This .gitignore file should be placed at the root of your Unity project directory
    #
    # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
    #
    /[Ll]ibrary/
    /[Tt]emp/
    /[Oo]bj/
    /[Bb]uild/
    /[Bb]uilds/
    /[Ll]ogs/
    
    # MemoryCaptures can get excessive in size.
    # They also could contain extremely sensitive data
    /[Mm]emoryCaptures/
    
    # Asset meta data should only be ignored when the corresponding asset is also ignored
    !/[Aa]ssets/**/*.meta
    
    # Uncomment this line if you wish to ignore the asset store tools plugin
    # /[Aa]ssets/AssetStoreTools*
    
    # Autogenerated Jetbrains Rider plugin
    /[Aa]ssets/Plugins/Editor/JetBrains*
    
    # Visual Studio cache directory
    .vs/
    
    # Gradle cache directory
    .gradle/
    
    # Autogenerated VS/MD/Consulo solution and project files
    ExportedObj/
    .consulo/
    *.csproj
    *.unityproj
    *.sln
    *.suo
    *.tmp
    *.user
    *.userprefs
    *.pidb
    *.booproj
    *.svd
    *.pdb
    *.mdb
    *.opendb
    *.VC.db
    
    # Unity3D generated meta files
    *.pidb.meta
    *.pdb.meta
    *.mdb.meta
    
    # Unity3D generated file on crash reports
    sysinfo.txt
    
    # Builds
    *.apk
    *.unitypackage
    
    # Crashlytics generated file
    crashlytics-build.properties
    
    # NuGet Build Process Generated
    # This section covers files that are generated when consuming/using MRTK from NuGet
    # May not be relevant if consuming via .unitypackages
    /NuGet/*
    !/NuGet/BuildSource.proj
    /MRTKBuild/
    /MSBuild/
    /PackagesCopy/
    !/scripts/Packaging/NuGetRestoreProject.csproj
    
    # MSBuildForUnity generated
    # This section covers files that are generated by the MSBuildForUnity system
    # which MRTK uses to consume certain NuGet packages. Useful for when MSBuildForUnity
    # is enabled on the project (in the MRTK configurator)
    MSBuildForUnity.Common.props
    /*.msb4u.csproj.meta
    *.msb4u.csproj.meta
    /*.msb4u.sln.meta
    *.msb4u.sln.meta
    Dependencies*
    Nuget.config*
    
    # DotNetAdapter specific
    # This section covers files that are deployed by the imported DotNetWinRT NuGet package
    # This is primarily used for Unity Editor to HoloLens 2 in-editor remoting
    !/Assets/MRTK/Providers/WindowsMixedReality/Shared/DotNetAdapter/DotNetAdapter.csproj*
    Assets/MRTK/Providers/WindowsMixedReality/Shared/DotNetAdapter/.bin/
    Assets/MRTK/Providers/WindowsMixedReality/Shared/DotNetAdapter/.obj/
    

    ProjectPreferences.asset 文件

    项目范围的MRTK设置可以在 Edit -> Project Settings -> Mixed Reality Toolkit 下找到 。这些设置将保存到一个文件中, 在资源文件夹的这个位置:

    Assets/MixedRealityToolkit.Generated/ProjectPreferences.asset
    

    如果您的项目将有多个合作者,建议在完成MRTK设置的初始设置之后检查该asset文件。特别是,检查以下设置:

    Lock SDK Profiles - 如果这被禁用,默认的MRTK配置文件将是全局可编辑的,这将使MRTK升级具有挑战性(它可能导致框架本身的合并冲突)

    Ignore MRTK project configurator - 如果禁用此功能,项目配置器将显示当前MRTK设置是否与MRTK推荐的默认设置不匹配。由于您的项目可能已明确选择不启用某些设置,因此选中此设置将防止其他合作者无意中看到此对话框更改了设置。这些设置应该由项目设置人员配置,然后由其他合作者忽略。

    Auto-enable UWP capabilities - 如果禁用了这个功能,某些功能(例如,眼动跟踪)在部署到设备时可能会悄无声地失败,因为Unity不会自动将所需的运行时功能添加到应用程序清单中。检查此设置将确保您的应用程序部署体验不会出现此类问题。

    • Improve this Doc
    In This Article
    • gitignore
    • ProjectPreferences.asset 文件
    Back to top Generated by DocFX