2D extras is a very useful plug-in for tilemap officially made by unity. You can download it from GitHub
Like me, you may encounter an error in the custom rule tile menu script in the downloaded 2D extras package
According to the error prompt, the non-existent function is called. After searching, the corresponding function is indeed missing
Solution 1:
Just open the script and replace it with the following code
1 namespace UnityEditor
2 {
3 static class CustomRuleTileMenu
4 {
5 [MenuItem("Assets/Create/Custom Rule Tile Script", false, 89)]
6 static void CreateCustomRuleTile()
7 {
8 CreateScriptAsset("Assets/Tilemap/Rule Tiles/Scripts/ScriptTemplates/NewCustomRuleTile.cs.txt", "NewCustomRuleTile.cs");
9 }
10
11 static void CreateScriptAsset(string templatePath, string destName)
12 {
13 typeof(ProjectWindowUtil)
14 .GetMethod("CreateScriptAsset", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
15 .Invoke(null, new object[] { templatePath, destName });
16 }
17 }
18 }
Solution 2:
Or, use the 2D techdemos version, which is officially provided for you to learn. In addition to the complete 2D extras, there are also some examples. According to my personal test, there is no problem with this version. It is just that there are too many sample materials and palettes, which will be a bit of an eyesore when you don’t need them
In fact, the code in solution 1 is the code of the custom rule tile menu script file in the 2D techdemo version
If you are interested, comparing the content of the custom rule tile menu scripts of 2D extras and 2D techdemos, it is not difficult to see that they realize the same function, but there are some differences in the implementation methods. What I do is equivalent to replacing parts
Similar Posts:
- Unity5.4.x Update to Unity2019 Error: -System.MissingMethodException
- Unity2018: How to Solve C# Project Open Error
- Modify the script execution permission of PowerShell, and solve the problem of error reporting of commands executed by built-in terminals such as vscode (XX cannot recognize the name of cmdlets, functions, script files or runnable programs)
- [Solved] MERFISH_debug Error: codebook = fastaread(codebook);
- [Solved] Java Call Error: java.lang.IllegalArgumentException: wrong number of arguments
- When using bootstrap modal box, uncaught typeerror: $(…). Modal is not a function
- What is [unity] assembly definition?
- Nginx+PHP FastCGI sent in stderr: “Primary script unknown” while reading response head…
- Eclipse Error:The selection cannot be launched, and there are no recent launches
- Xlua#: How to Call C