Unity3D版本控制 UnityYAMLMerge合并scene和prefab文件_unity prerfab merge_kuangben2000的博客-程序员宝宝

Unity3D版本控制 UnityYAMLMerge合并scene和prefab文件

https://blog.csdn.net/jueane/article/details/78915130

Smart Merge

Unity incorporates a tool called UnityYAMLMerge that can merge scene and prefab files in a semantically correct way. The tool can be accessed from the command line and is also available to third party version control software.

Setting Up Smart Merging in Unity

In the Editor Settings (menu: Edit > Project Settings > Editor), you have the option to select a third party version control tool (Perforce or PlasticSCM, for example). When one of these tools is enabled, you will see a Smart Merge menu under the Version Control heading. The menu has four options:

  • Off: use only the default merge tool set in the preferences with no smart merging.
  • Premerge: enable smart merging, accept clean merges. Unclean merges will create premerged versions of base, theirs and mine versions of the file. Then, use these with the default merge tool.
  • Ask: enable smart merging but when a conflict occurs, show a dialog to let the user resolve it (this is the default setting).

Setting up UnityYAMLMerge for Use with Third Party Tools

The UnityYAMLMerge tool is shipped with the Unity editor; assuming Unity is installed in the standard location, the path to UnityYAMLMerge will be:

 
  1. C:\Program Files\Unity\Editor\Data\Tools\UnityYAMLMerge.exe

  2.  
  3. or

  4.  
  5. C:\Program Files (x86)\Unity\Editor\Data\Tools\UnityYAMLMerge.exe

  6.  

…on Windows and

 
  1. /Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge

  2.  

…on Mac OSX (use the Show Package Contents command from the Finder to access this folder).

UnityYAMLMerge is shipped with a default fallback file (called mergespecfile.txt, also in the Tools folder) that specifies how it should proceed with unresolved conflicts or unknown files. This also allows you to use it as the main merge tool for version control systems (such as git) that don’t automatically select merge tools based on file extensions. The most common tools are already listed by default in mergespecfile.txt but you can edit this file to add new tools or change options.

You can run UnityYAMLMerge as a standalone tool from the command line (you can see full usage instructions by running it without any arguments). Set-up instructions for common version control systems are given below.

P4V

  • Go to Preferences > Merge.
  • Select Other application.
  • Click the Add button.
  • In the extension field, type .unity.
  • In the Application field, type the path to the UnityYAMLMerge tool (see above).
  • In the Arguments field, type merge -p %b %1 %2 %r
  • Click Save.

Then, follow the same procedure to add the .prefab extension.

Git

Add the following text to your .git or .gitconfig file:

 
  1. [merge]

  2. tool = unityyamlmerge

  3.  
  4. [mergetool "unityyamlmerge"]

  5. trustExitCode = false

  6. cmd = '<path to UnityYAMLMerge>' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

  7.  

Mercurial

Add the following text to your .hgrc file:

 
  1. [merge-patterns]

  2. **.unity = unityyamlmerge

  3. **.prefab = unityyamlmerge

  4.  
  5. [merge-tools]

  6. unityyamlmerge.executable = <path to UnityYAMLMerge>

  7. unityyamlmerge.args = merge -p --force $base $other $local $output

  8. unityyamlmerge.checkprompt = True

  9. unityyamlmerge.premerge = False

  10. unityyamlmerge.binary = False

  11.  

SVN

Add the following to your ~/.subversion/config file:

 
  1. [helpers]

  2. merge-tool-cmd = <path to UnityYAMLMerge>

  3.  

TortoiseGit

  • Go to Preferences > Diff Viewer > Merge Tool and click the Advanced button.
  • In the popup, type .unity in the extension field.
  • In the External Program field type:
 
  1. <path to UnityYAMLMerge> merge -p %base %theirs %mine %merged

  2.  

Then, follow the same procedure to add the .prefab extension.

PlasticSCM

  • Go to Preferences > Merge Tools and click the Add button.
  • Select External merge tool.
  • Select Use with files that match the following pattern.
  • Add the .unity extension.
  • Enter the command:
 
  1. <path to UnityYAMLMerge> merge -p "@basefile" "@sourcefile" "@destinationfile" "@output"

  2.  

Then, follow the same procedure to add the .prefab extension.

SourceTree

  • Go to Tools > Options > Diff.
  • Select Custom in the Merge Tool dropdown.
  • Type the path to UnityYAMLMerge in the Merge Command text field.
  • Type merge -p $BASE $REMOTE $LOCAL $MERGED in the Arguments text field.

 

 

 

 

 

 

 

 

 

 

 

 

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/kuangben2000/article/details/105679569

智能推荐

什么是防抖和节流?_chase…的博客-程序员宝宝

防抖指触发事件后在 n 秒内函数只能执行一次,如果在 n 秒内又触发了事件,则会重新计算函数执行时间应用场景:用户注册时候的手机号验证和邮箱验证;搜索框节流指连续触发事件但是在N秒中只执行一次函数,即每间隔某个事件去执行某个函数,避免函数的过多执行应用场景:window对象的resize、scroll事件;拖拽时候的mousemove;文字输入、自动完成的keyup事件...

打开由于被这台计算机限制而无法打开没解决,Win8打开CMD时弹出“本次操作由于这台计算机的限制而被取消"如何解决..._宋玄宾的博客-程序员宝宝

win8系统经常使用命令提示符(CMD)来进行一些操作,既方便又高效。有些用户在Win8 64位系统中打开CMD时弹出“本次操作由于这台计算机的限制而被取消,请与你的系统管理员联系”,导致无法顺利打开。那么如何解决呢?可能是组策略限制了CMD导致无法打开。大家只要参考下面三种方法操作设置,即可轻松解决问题了。解决方法一:1、依次打开C:\WINDOWS\system32,在该目录下,找到gpedi...

Ajax-hook 原理解析 注入js_ajaxhook.min.js_wang880117的博客-程序员宝宝

wendux/Ajax-hookAjax-hook 原理解析Js 拦截全局ajax请求js实用方法记录-js动态加载css、js脚本文件js 拦截全局 ajax 请求

Vivado中Debug操作方式总结(ILA)_set up debug怎么用_视觉鸟的博客-程序员宝宝

Vivado中提供了多种Debug的操作方式,下面就来总结一下:方式一:代码中例化ILA IP核需要探测多少个信号,信号的位宽是多少,直接选择即可:下面界面可以选择探测信号宽度以及触发方式:方式二:通过网表标记综合后生成网表,在网表中设置Debug:Mark Debug或者在综合后的原理图中Mark Debug,这和网表debug是一致的:在标记Debug后,就等于选择了需要debug的信号,之后在综合设置里设置Debug参数即可:选择需要Debug的信号,设置时钟域以及触发方式等

springcloud服务治理 ---- Ribbon 客户端负载均衡_chenzm666666的博客-程序员宝宝

Eureka client– 高可用单机环境下使用端口进行区别,启动多个即可。在客户端有多个的情况下,可以使用Ribbon进行负载均衡(eureka依赖ribbon,无需在导ribbon坐标)Ribbon 客户端负载均衡ribbon简洁:Ribbon是 Netflix 提供的一个基于HTTP和TCP的客户端负载均衡工具。Ribbon主要有两个功能:1.简化远程调用------使用 Ribbon 简化restTemplate调用* 1. 在声明restTemplate的Bean时候,添加一个

Navicat Premium连接sqlserver出现的问题_zhyu071010的博客-程序员宝宝

我这边用的是navicat premium15连接sqlserver数据库报错:[IM002][Microsoft][ODBC驱动程序管理器]这个时候需要找到你的navicat premium安装目录,找到msodbcsql_64.msi文件如果出现弹窗错误:please install microsoft visual c++ 2017就先安装microsoft visual c++ 2017文件,最后再安装上面的msodbcsql_64.msi文件...

随便推点

Python, C++和Java代码互翻,Facebook开发首个自监督神经编译器_AI科技大本营的博客-程序员宝宝

译者| 刘畅出品 |AI科技大本营(ID:rgznai100)将早期的编程语言(例如COBOL)的代码库迁移到现在的编程语言(例如Java或C++)是一项艰巨的任务,它需要源语言和...

短址(short URL)原理及其实现_短地址_业余草的博客-程序员宝宝

前言最近看了一些关于短址(short URL)方面的一些博客,有些博客说到一些好的东西,但是,也不是很全,所以,这篇博客算是对其它博客的一个总结吧。介绍短址,顾名思义,就是把长的 URL 转成短的 URL, 现在提供这种服务的有很多公司,我们以google家的 URL shortener 服务: http://goo.gl/ 为例。首先我们到 http://goo.gl/,然后把本...

假期陪伴孩子学习的一点体会与感受_包云岗的博客-程序员宝宝

和大家一起起探讨一下孩子教育与成长。两个学习规律平时会了解一些关于学习方法本身的研究,其中有两条规律印象特别深刻:1.人很难通过听讲完全掌握知识 这个学习金字塔非常形象地描绘了各种学习方式对掌握知识的效果。可以看到仅仅通过听讲,能掌握的知识只有5%,只有通过实作演练(即练习)才能较好地掌握知识(&gt;70%)。2.人学习到的知识会随时间遗忘 德国心理学家艾宾浩斯(Hermann ...

win7需要计算机管理员权限,Win7系统提示“需要管理员权限”如何解决?_熊江乔的博客-程序员宝宝

最近有Win7系统用户反映,很经常在安装软件或者对文件进行操作的时候,系统提示“需要管理员权限”,这让用户感觉很厌烦。其实对于这个问题,可能是系统设置问题,也可能是文件本身设置了安全访问限制,只要进行相应的设置就能解决问题了。下面,我们就一起来看看Win7系统提示“需要管理员权限”的解决方法。方法/步骤一、更改用户账户控制1.点击开始——控制面板——用户账户和家庭安全——用户账户——更改用户账户控...

项目中登录接口_little_dream2018的博客-程序员宝宝

我看了下,登录的时候,走的是直接是 检验的接口点击登录 触发 [email protected] class LoginController{ protected static final Logger log = LoggerFactory.getLogger(LoginController.class); @Auto...

LoadRunner进行性能测试时遇到的问题汇总_emily_0418的博客-程序员宝宝

问题源及解决方案:1. Action.c(4): Error -27796: Failed to connect to server "10.10.10.2:81": [10048] Address already in useTry changing the registry value HKEY_LOCAL_MACHINE\System\CurrentControlSet\Serv

推荐文章

热门文章

相关标签